Whenever any money is placed in any fund for the retirement or payment of the bonds of nonconsenting holders such money shall be used only for that purpose. After all of the bonds of the nonconsenting holders have been paid or retired any sum remaining in the fund shall be returned to the city or person which advanced the money.