Purchasers at public sales of personal property subject to the lien of a mortgage shall give bond and security in double the value of the property to the officer making the sale and conditioned not to remove the property from the state and for its forthcoming answer to the lien; provided, however, that prior to the sale the mortgagee or his or her agent shall file with the officer an affidavit stating the amount due on the mortgage and that he or she expects the loss of the property unless the bond is taken. On failure to give the bond, the property shall be resold at the risk of the purchaser.