When such new bond is taken, approved and filed, it shall immediately operate as a discharge of all the sureties in the former bond from all liability arising from any subsequent misconduct or default of the principal therein, and such sureties shall thenceforth be liable on such bond only for such breaches thereof as shall have happened prior to the taking, approving and filing of the new bond.