Section 38. Any credit union may establish an account to receive deposits from a lessor acting as a trustee for funds received and held by such trustee pursuant to paragraph (a) of subsection (3) of section fifteen B of chapter one hundred and eighty-six. Such account may be established as required by said section fifteen B for the purpose of holding security deposits taken by a lessor of residential dwelling units owned or managed by said lessor, but the terms of said account shall be such as to place said deposit beyond the claim of a creditor of the lessor, including a foreclosing mortgagee or trustee in bankruptcy, and as will provide for the transfer of said deposit to a subsequent owner of any property for which such security deposit was taken. Interest or dividends accruing on said deposit shall be paid to the lessor pursuant to the terms of the deposit. Withdrawals and payments made by the corporation from said account shall discharge the liability of said corporation to all persons.