Im really confused here...
If your selling the townhouse, why do you need a loan?
It is not required of you to pay closing cost. The buyer pays closing cost and in many areas they have programs to help buyers with closing cost.
If what you are referring to as far as break even cause your home is not what you paid for it, thats an issue many are going through. You would be responsible for the balance still owed on the home if you couldnt find a buyer for the full amount.
Yes foreclosure and short sale are options also.
As far as taking out a loan for the difference of the sale, you would more then likely be taking out a personal loan you would have to apply for. You couldn't take out a second mortgage because you wouldnt own the home any longer.
or another option could be if there is a property management company in the city that can take care of it for you...for a fee of course but it may be worth looking into.