Section 12. Real estate held by an executor or administrator in mortgage, or taken on execution by him, may, at any time before the right of redemption is foreclosed, be sold subject to such right, in the same manner as personal property of a person deceased; and after such right has been foreclosed, it may be sold in the same manner as real estate of which the deceased died seized.