MINOR: task: only check TASK_WOKEN_ANY to decide to requeue a task

After processing a task, its RUNNING bit is cleared and at the same time
we check for other bits to decide whether to requeue the task or not. It
happens that we only want to check the TASK_WOKEN_* bits, because :
  - TASK_RUNNING was just cleared
  - TASK_GLOBAL and TASK_QUEUE cannot be set yet as the task was running,
    preventing it from being requeued

It's important not to catch yet undefined flags there because it would
prevent addition of new task flags. This also shows more clearly that
waking a task up with flags 0 is not something safe to do as the task
will not be woken up if it's already running.

(cherry picked from commit 8fe4253bf688c90da5bd4cfefa36e5360a167a41)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit d368d0b1d6563e8e64a9d734cefe3c8a18bfbc51)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/task.c b/src/task.c
index 9a55a60..06eab27 100644
--- a/src/task.c
+++ b/src/task.c
@@ -434,7 +434,7 @@
 			}
 
 			state = _HA_ATOMIC_AND(&t->state, ~TASK_RUNNING);
-			if (state)
+			if (state & TASK_WOKEN_ANY)
 				task_wakeup(t, 0);
 			else
 				task_queue(t);