§ 26. Collection of execution; when a defence to subsequent action. It is a defence by a surety, against whom an action is brought upon an official bond or undertaking, that he, or any other surety or sureties, have been or will be compelled, for want of sufficient property of the public officer to pay, upon one or more judgments recovered against him or them, upon the same bond or undertaking, an aggregate amount, exclusive of costs, officers' fees, and expenses, equal to the sum for which the defendant is liable, by reason of the bond or undertaking. It is a partial defence, that the difference between the aggregate amount, so paid, or to be paid, and the sum for which the defendant is thus liable, is less than the amount of the plaintiff's demand.