Gosselin walks off Padres, D-backs avoid cellar