A surety in such recognizance may, by leave of the court, after default, and either before or after process has been issued against him, pay to the county treasurer or clerk of the court the amount for which he was bound as surety, with such costs as the court shall direct, and shall be thereupon forever discharged.
Mass. Gen. Laws ch. 276, § 72