The proceeds of sale shall be invested under the direction of the court, for the use and benefit of the persons entitled to the estate, and, in case of a trust estate, subject to the uses, limitations, and conditions contained in the writing creating the trust. But into whosesoever hands such proceeds may be placed, the court shall take ample security and from time to time require additional security, if necessary, and make any other proper orders for the faithful application of the fund, and for the management and preservation of any property, or securities in which the same may be invested, and for the protection of the rights of all persons interested therein, whether such rights be vested or contingent.