BUG/MEDIUM: threads: Fix the sync point for more than 32 threads

In the sync point, to know if a thread has requested a synchronization, we call
the function thread_need_sync(). It should return 1 if yes, otherwise it should
return 0. It is intended to return a signed integer.

But internally, instead of returning 0 or 1, it returns 0 or tid_bit
(threads_want_sync & tid_bit). So, tid_bit is casted in integer. For the first
32 threads, it's ok, because we always check if thread_need_sync() returns
something else than 0. But this is a problem if HAProxy is started with more
than 32 threads, because for threads 33 to 64 (so for tid 32 to 63), their
tid_bit casted to integer are evaluated to 0. So the sync point does not work for
more than 32 threads.

Now, the function thread_need_sync() respects its contract, returning 0 or
1. the function thread_no_sync() has also been updated to avoid any ambiguities.

This patch must be backported in HAProxy 1.8.
diff --git a/src/hathreads.c b/src/hathreads.c
index 839b086..0d690f3 100644
--- a/src/hathreads.c
+++ b/src/hathreads.c
@@ -82,7 +82,7 @@
 /* Returns 1 if no thread has requested a sync. Otherwise, it returns 0. */
 int thread_no_sync()
 {
-	return (threads_want_sync == 0);
+	return (threads_want_sync == 0UL);
 }
 
 /* Returns 1 if the current thread has requested a sync. Otherwise, it returns
@@ -90,7 +90,7 @@
  */
 int thread_need_sync()
 {
-	return (threads_want_sync & tid_bit);
+	return ((threads_want_sync & tid_bit) != 0UL);
 }
 
 /* Thread barrier. Synchronizes all threads at the barrier referenced by