rpc: Compute number of confirmations of a block from block height

Currently this uses a CMerkleTx, but that makes no sense as we
have the CBlockIndex available. As noted by @jgarzik.
Move CMerkleTx to wallet.cpp/h

It is only used by the wallet so it has no place in main.
Merge pull request #4778