First-Principles Studies on Hydrogen Desorption Mechanism of MgnH2n (n = 3, 4)