Upon the resignation, removal from office or expiration of the term of office of a sheriff, he shall execute all precepts in his hands, complete all official business previously committed to him and deliver to his successor all prisoners in his custody.