Coinbase check fails when verifying multiple held blocks

The transaction depth check compares against the current chain head.
But this is incorrect if the block being validated is higher than the
chain head due to one or more held blocks which have been released.