Quantum Monte Carlo calculations of the structural properties and the B1-B2 phase transition of MgO