MINOR: debug: make ha_thread_dump() and ha_task_dump() take a buffer

Instead of having them dump into the trash and initialize it, let's have
the caller initialize a buffer and pass it. This will be convenient to
dump multiple threads at once into a single buffer.
diff --git a/include/common/debug.h b/include/common/debug.h
index ae6cdc8..3fb96c5 100644
--- a/include/common/debug.h
+++ b/include/common/debug.h
@@ -83,8 +83,9 @@
 
 
 struct task;
-void ha_task_dump(const struct task *task, const char *pfx);
-void ha_thread_dump(int thr);
+struct buffer;
+void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx);
+void ha_thread_dump(struct buffer *buf, int thr, int calling_tid);
 
 /* This one is useful to automatically apply poisonning on an area returned
  * by malloc(). Only "p_" is required to make it work, and to define a poison