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 share and proportions to which they are respectively entitled, or when shares and proportions have been previously adjudged by the court, such securities shall be taken in the names of and payable to the parties respectively entitled thereto, and shall be delivered to such parties upon their receipt therefor. Such agreement and receipt shall be returned and filed with the clerk.