If a vacancy occurs in the office of sheriff of a county, the undersheriff of the county shall in all things execute the office of sheriff, until a sheriff is elected and qualified. A default or misfeasance in office of an undersheriff in that capacity, shall be considered to be a breach of the condition of the bond given on behalf of or by the sheriff who appointed the undersheriff, and also a breach of the condition of the bond executed on behalf of or by the undersheriff to the sheriff by whom the undersheriff was appointed.