Add negative test for duplicate block.

This commit adds tests for the error path when processing a block that is
already in the main chain.