There is an interesting series of comments in the Portland Housing Blog where a homeowner put a home up for sale because s/he wanted to cash out thinking that if it didn't sell he would get a mortgage (evidently owned free and clear). The house didn't sell so it was taken off the market and the owner applied for a modest mortgage.
The mortgage was not approved because the home was offered for sale within the last 6 months.
Who would have thunk-ed it? Lesson: if you want cash re-fi first, then list the home.