This is a very interesting question.
I would imagine that this situation will occur more and more over the next couple of years where the sale price is less than what is owed on the mortgage, maybe a lot less!.
The bank will not release the mortgage until it is paid in full or allow the sale...