[BUG] fix the dequeuing logic to ensure that all requests get served

The dequeuing logic was completely wrong. First, a task was assigned
to all servers to process the queue, but this task was never scheduled
and was only woken up on session free. Second, there was no reservation
of server entries when a task was assigned a server. This means that
as long as the task was not connected to the server, its presence was
not accounted for. This was causing trouble when detecting whether or
not a server had reached maxconn. Third, during a redispatch, a session
could lose its place at the server's and get blocked because another
session at the same moment would have stolen the entry. Fourth, the
redispatch option did not work when maxqueue was reached for a server,
and it was not possible to do so without indefinitely hanging a session.

The root cause of all those problems was the lack of pre-reservation of
connections at the server's, and the lack of tracking of servers during
a redispatch. Everything relied on combinations of flags which could
appear similarly in quite distinct situations.

This patch is a major rework but there was no other solution, as the
internal logic was deeply flawed. The resulting code is cleaner, more
understandable, uses less magics and is overall more robust.

As an added bonus, "option redispatch" now works when maxqueue has
been reached on a server.
diff --git a/include/types/server.h b/include/types/server.h
index 462db2b..09eb1ba 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -78,12 +78,12 @@
 	char *rdr_pfx;				/* the redirection prefix */
 
 	struct proxy *proxy;			/* the proxy this server belongs to */
+	int served;				/* # of active sessions currently being served (ie not pending) */
 	int cur_sess, cur_sess_max;		/* number of currently active sessions (including syn_sent) */
 	unsigned maxconn, minconn;		/* max # of active sessions (0 = unlimited), min# for dynamic limit. */
 	int nbpend, nbpend_max;			/* number of pending connections */
 	int maxqueue;				/* maximum number of pending connections allowed */
 	struct list pendconns;			/* pending connections */
-	struct task *queue_mgt;			/* the task associated to the queue processing */
 	struct task *check;                     /* the task associated to the health check processing */
 
 	struct sockaddr_in addr;		/* the address to connect to */