Magnesium-Doped MAPbI3 Perovskite Layers for Enhanced Photovoltaic Performance in Humid Air Atmosphere.