Mavs, Maxi Kleber agree to three-year contract extension