If the creditor does any act which is inconsistent with the right of the surety, or omits to do, any act which his duty to the surety requires him to do, and the eventual remedy of the surety himself against the principal debtor is thereby impaired, the surety is discharged. Illustrations (a) B contracts to build a ship for C for, a given su...