Wainwright wins 13th, Cardinals edge Padres 3-2