MINOR: wdt: also consider that waiting in the thread dumper is normal

It happens that upon looping threads the watchdog fires, starts a dump,
and other threads expire their budget while waiting for the other threads
to get dumped and trigger a watchdog event again, adding some confusion
to the traces. With this patch the situation becomes clearer as we export
the list of threads being dumped so that the watchdog can check it before
deciding to trigger. This way such threads in queue for being dumped are
not attempted to be reported in turn.

This should be backported to 2.0 as it helps understand stack traces.
diff --git a/src/debug.c b/src/debug.c
index 9f538b6..0522f88 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -29,6 +29,11 @@
 #include <proto/stream_interface.h>
 #include <proto/task.h>
 
+/* mask of threads still having to dump, used to respect ordering. Only used
+ * when USE_THREAD_DUMP is set.
+ */
+volatile unsigned long threads_to_dump = 0;
+
 /* Dumps to the buffer some known information for the desired thread, and
  * optionally extra info for the current thread. The dump will be appended to
  * the buffer, so the caller is responsible for preliminary initializing it.
@@ -404,9 +409,6 @@
  */
 #define DEBUGSIG SIGURG
 
-/* mask of threads still having to dump, used to respect ordering */
-static volatile unsigned long threads_to_dump;
-
 /* ID of the thread requesting the dump */
 static unsigned int thread_dump_tid;