Any of such funds which may be invested or loaned out for the benefit of those who cannot be ascertained shall be paid over to the county treasurer as soon as they are collected. Such funds shall be by such treasurers credited to their respective general funds.