Do not hold the mining thread lock in restart_threads when calling the driver flush work commands.