The DWP has confirmed plans to close a Universal Credit loophole allowing some serious offenders to receive more than £800 a month while detained in hospital.