Corrosion and protection of magnesium alloys