Interrupt on new work

The miner now stops processing the current work when a new block
appears.