Royals beat Padres in the ninth on a bases-loaded walk