Limit maximum DB locks needed for blocks in a softfork.

This introduces an explicitly specified limit for the number of DB locks
that can be used for a new block.  This limit matches the rebased client
exactly, so that we don't run into the issue that Bitcoin faced in March
2013.  See also
https://github.com/bitcoin/bitcoin/commit/8c222dca4f961ad13ec64d690134a40d09b20813
and the corresponding commit to Namecore.
Merge pull request #200 from domob1812/db-lock-limit

Limit maximum DB locks needed for blocks in a softfork.