Magnesium sulfate for hair treatments