First-Principles Investigation of the Effect of Solutes on the Ideal Shear Resistance and Electronic Properties of Magnesium