I will dissagree with some of the previous answers, as they are predicated on a ratified contract meeting the requirement for the tax credit, which is not what the rules state. Please see the attached IRS fact sheet and you will notice in #1 that is says a binding contract, so the question then becomes when is the contract binding? Essentially you have an agreement between yourself and the seller, with a remaining contingency of bank approval, and as long as the contingency is outstanding you are not bound to perform. Prior to the banks approval, you have the ability to terminate the contract and receive your earnest money back.
In reality will the IRS system allow for a lot or most of these situations to get the credit... probably, but it would smart if you didn't. go in eyes wide open.