Effects of doping atoms on the generalized stacking-fault energies of Mg alloys from first-principles calculations