Do a disconnect on reset.

We have some issues with the state of foreman and workers not being
completely clean on resets (e.g., when connecting to a new master with
tasks in the queue). For example, some messages between foreman and
workers would still be processed, causing confusion at the master side
(e.g., reporting tasks that were not submitted, of task id confusions).

This commit does a 'hard reset' between foreman and workers,
disconnecting the workers to force a clean state. This is suboptimal, as
the workers need to reconnect to create the hierarchy again.
Factorize wq_reset and kill_all_tasks()