When security is taken by the referees on a sale, and the parties interested in such security, by an instrument in writing under their hands delivered to the referees, agree upon the shares and proportions to which they respectively are entitled, or when shares and proportions previously have been adjudged by the court, such securities must be taken in the names of and must be payable to the parties respectively entitled thereto, and must be delivered to such parties upon their receipts therefor. Such agreement and receipts must be returned and filed with the clerk.