Phase-resolved energy spectra of the Crab pulsar in the range of 50-400 GeV measured with the MAGIC telescopes