If you have a long standing unconfirmed transaction, simply right click the transaction, copy the txid. Then execute the command "erasetransaction txid" in the console. After that reopen the client with the command -salvagewallet, and the money should be back.
Great! That cleaned up my wallet nicely, and everything is at it should be.