Corrected block maturity test.
Added GetHeightInMainChain() method.
Corrected call to GetDepthInMainChain() with GetHeightInMainChain() when checking coin maturity.
DRY calculation for required maturity depth

Having this defined in multiple places is suboptimal and may lead
to porting issues, so I extracted it into it's own function and
let both implementations call that instead.
Merge pull request #481 from patricklodder/1.7-dev-maturity-depth

fix maturity depth in CMerkleTx::GetBlocksToMaturity