Isomonodromic deformation of resonant rational connections