The court may, whenever the nature of the case demands, require all, or any of the parties, before they shall receive any share of the moneys arising from a sale under this chapter, to give approved security, in such sum as the court may direct, to refund such share, with interest thereon, in case it should thereafter appear that such party was not entitled thereto.