The tax herein imposed shall be fully paid, and have priority out of the proceeds of any judicial sale of real estate before any other obligation, claim, lien, judgment, estate or costs of the sale and of the writ upon which the sale is made except the state realty transfer tax, and the sheriff, or other officer, conducting said sale, shall pay the tax herein imposed out of the first moneys paid to him in connection therewith. If the proceeds of the sale are insufficient to pay the entire tax herein imposed, the purchaser shall be liable for the remaining tax.