Where an order of committal is made under section 181, the judgment debtor may, at any time pay, either to the bailiff or, if the judgment debtor is in prison, to the officer in charge of the prison the amount stated in the order, and obtain his discharge.