Origin of the Voltage Hysteresis of MgH2 Electrodes in Lithium Batteries