Every surety of any sheriff or other officer may be made a party to the judgment rendered as aforesaid, against the sheriff or other officer, by action, to be commenced and prosecuted as in other cases. But the goods and chattels, lands and tenements of any such surety shall not be liable to be taken on execution, when sufficient goods and chattels, lands and tenements of the sheriff or other officer, against whom execution may be issued, can be found to satisfy the same. Nothing herein contained shall prevent either party from proceeding against such sheriff or other officer by attachment, at his election.