If the owner of two or more properties mortgages them to one person and -then sells one or more of the properties to another person, the buyer is, in the absence of a contract to the contrary, entitled to have the mortgage-debt satisfied out of the property or properties not sold to him, so far as the same will extend, but not so as to prejudice...