Witt HR in late rally after Gallen exits, Royals beat Dbacks