(a) Whenever a judgment by motion or action at law is had against a sheriff, coroner, or constable, and the official sureties of such officer, for a failure of duty in and about an execution, and the amount of such judgment has been paid by the sureties, the sureties are entitled, at their cost and risk, to issue an execution for their benefit on the original judgment.
(b) The clerk shall, in such case, endorse upon the execution at whose instance it is sued out, and take from such persons bond with security in a sufficient amount for the costs and damages which may accrue.