Grazing incidence X-ray scattering study of the Pd/MgO(001) interface during its formation