If the trustee has given a bond as required in accordance with this title, any sale, pledge, mortgage or exchange by a trustee, whether pursuant to a decree or to the exercise of a power conferred by the trust instrument or of a power under this title, shall pass the full title of the trust in the property, unless otherwise specified. Persons dealing with the trustee shall have no obligation to see to the proper application of the cash or other assets given in exchange for the property of the trust. A sale or exchange by a trustee pursuant to a decree under section 3353 (relating to order of court) shall have the effect of a judicial sale as to the discharge of liens, but the court may decree a sale or exchange freed and discharged from the lien of any mortgage otherwise preserved from discharge by existing law if the holder of the mortgage consents by writing filed in the proceeding. No sale, mortgage, exchange or conveyance shall be prejudiced by the subsequent dismissal of the trustee. No sale, mortgage, exchange or conveyance by a testamentary trustee shall be prejudiced by the terms of a will or codicil thereafter probated if the person dealing with the trustee did so in good faith.