Improve handling of obscure reorganizations

This fixes some weird reorganization issues that probably don't normally
occur, but can be triggered when blacklisting arbitrary blocks is enabled.
Add blacklistblock RPC

As this is a fairly dangerous operation, it is normally disabled when
building. Define ENABLE_BLOCK_BLACKLISTING to enable compiling it in.
header-first begin