Robustness of adiabatic passage through a quantum phase transition