Ab initio thermodynamics and phase diagram of solid magnesium: A comparison of the LDA and GGA