BUG/MEDIUM: pollers: Use a global list for fd shared between threads.

With the old model, any fd shared by multiple threads, such as listeners
or dns sockets, would only be updated on one threads, so that could lead
to missed event, or spurious wakeups.
To avoid this, add a global list for fd that are shared, using the same
implementation as the fd cache, and only remove entries from this list
when every thread as updated its poller.

[wt: this will need to be backported to 1.8 but differently so this patch
 must not be backported as-is]
diff --git a/src/fd.c b/src/fd.c
index 01de0e1..4e88d30 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -169,6 +169,7 @@
 
 volatile struct fdlist fd_cache ; // FD events cache
 volatile struct fdlist fd_cache_local[MAX_THREADS]; // FD events local for each thread
+volatile struct fdlist update_list; // Global update list
 
 unsigned long fd_cache_mask = 0; // Mask of threads with events in the cache
 
@@ -244,7 +245,6 @@
 	int prev;
 	int next;
 	int last;
-
 lock_self:
 #if (defined(HA_CAS_IS_8B) || defined(HA_HAVE_CAS_DW))
 	next_list.next = next_list.prev = -2;
@@ -492,6 +492,7 @@
 		goto fail_info;
 
 	fd_cache.first = fd_cache.last = -1;
+	update_list.first = update_list.last = -1;
 	hap_register_per_thread_init(init_pollers_per_thread);
 	hap_register_per_thread_deinit(deinit_pollers_per_thread);
 
@@ -499,7 +500,7 @@
 		HA_SPIN_INIT(&fdtab[p].lock);
 		/* Mark the fd as out of the fd cache */
 		fdtab[p].cache.next = -3;
-		fdtab[p].cache.next = -3;
+		fdtab[p].update.next = -3;
 	}
 	for (p = 0; p < global.nbthread; p++)
 		fd_cache_local[p].first = fd_cache_local[p].last = -1;