Make GetAvailableCredit run GetHash() only once per transaction.

This makes the first getbalance/getinfo 63x faster on my wallet.

(cherry picked from commit bitcoin/bitcoin@a60ab0ba89289433563c4c0993904acbca8c99ff)
Merge pull request #378 from leofidus/1.7-bitcoin3973

Make GetAvailableCredit run GetHash() only once per transaction.