It shall be lawful for any judge of the court of common pleas aforesaid, or for the prothonotary of such court, to make an order for discharge of any debtor arrested, detained, or held by virtue of any process or bail piece, as aforesaid, on his giving a bond to the plaintiff in such suit or proceeding, in such amount, and with such security, as shall be approved by such judge or prothonotary.
39 P.S. § 244