Section 21. Supplementary proceedings shall be dismissed, and if the debtor or, if a corporation or trust with transferable shares, its officer, trustee or agent, has been imprisoned, he or it shall be discharged from custody, on payment in full to the creditor or his attorney of the amount due on the judgment, with all the costs of the proceedings, or, unless the judgment is upon a bond or recognizance given under the provisions of this chapter, on the giving to the creditor or his attorney of a bond, payable to the creditor, with sufficient surety or sureties, approved by the creditor, his attorney or the court, conditioned that the debtor shall pay to the creditor the amount due on the judgment, with all the costs of the proceedings, within sixty days after the date of giving such bond or within such longer time as the court may allow.