Betts hits tying HR in 9th, Dodgers beat Diamondbacks in 10