Fix a mining bug that occurs during reorgs (#325)
Fix a mining bug that occurs during reorgs (#325)

When a main chain block has been reorganized out, the current
template for mining should be dropped because the parent no
longer exists in the main chain. Fixes #324.
jrick/btcd,decred/dcrd,jrick/btcd,jrick/dcrd,decred/dcrd,jrick/dcrd,jcmincke/dcrd,jrick/btcd,jcmincke/dcrd,jcmincke/dcrd