Limit blocks by BDB locks required.

This is a temporary measure to make the rebased client "compatible" with
the old BDB-based one.

Based on
https://github.com/bitcoin/bitcoin/commit/8c222dca4f961ad13ec64d690134a40d09b20813.