SABMiller and Diageo have agreed to settle a dispute between the two groups' brewing subsidiaries in Tanzania.