1) what was the old loan balance on the closing statement?
2) what was the new loan balance on the closing statement
if 2) was higher than 1), it was 'cash out'. it's that simple. doesn't matter that some of the money was used to adjust the escrow or pay closing costs.
you'll get credit for the pre-paid interest on the 1098 form.
also, while 100% of the interest is not tax deductible as you state 2) is $9,000 than 1), as you are paying down some principle each month, it won't be too long until the new balance is back to where the old balance was and at that point, the interest is 100% tax deductible.