When the mortgaged property is a lease and the mortgagor obtains a renewal of the lease, the mortgagee, in the absence of a contract to the contrary, shall, for the purposes of the security, be entitled to the new lease.