Mavs use buzzer beater to top Spurs