When any person is bound, in writing, as surety for another for the payment of money, or the performance of any other contract, apprehends that his principal is likely to become insolvent or to remove himself from the state, without discharging the contract, if a right of action has accrued on the contract, he may, in writing, require the creditor to sue forthwith upon the same; and unless such creditor, within a reasonable time and with due diligence, commences an action thereon, and prosecutes the same to final judgment and proceeds with the enforcement thereof, the surety shall be discharged; but such discharge shall not in any case affect the rights of the creditor against the principal debtor.
740 ILCS 155/1