MIDIS: near-infrared rest-frame morphology of massive galaxies at 3 < z < 5 in the Hubble eXtreme Deep Field