A surety may maintain an action against his principal to compel him to discharge the debt or liability for which the surety is bound, after it becomes due.