MINOR: listener: split dequeue_all_listener() in two

We use it half times for the global_listener_queue and half times
for a proxy's queue and this requires the callers to take care of
these. Let's split it in two versions, the current one working only
on the global queue and another one dedicated to proxies for the
per-proxy queues. This cleans up quite a bit of code.
diff --git a/src/listener.c b/src/listener.c
index 49af4fd..848b01e 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -463,12 +463,12 @@
 	return ERR_NONE;
 }
 
-/* Dequeues all of the listeners waiting for a resource in wait queue <queue>. */
-void dequeue_all_listeners(struct mt_list *list)
+/* Dequeues all listeners waiting for a resource the global wait queue */
+void dequeue_all_listeners()
 {
 	struct listener *listener;
 
-	while ((listener = MT_LIST_POP(list, struct listener *, wait_queue))) {
+	while ((listener = MT_LIST_POP(&global_listener_queue, struct listener *, wait_queue))) {
 		/* This cannot fail because the listeners are by definition in
 		 * the LI_LIMITED state.
 		 */
@@ -476,6 +476,19 @@
 	}
 }
 
+/* Dequeues all listeners waiting for a resource in proxy <px>'s queue */
+void dequeue_proxy_listeners(struct proxy *px)
+{
+	struct listener *listener;
+
+	while ((listener = MT_LIST_POP(&px->listener_queue, struct listener *, wait_queue))) {
+		/* This cannot fail because the listeners are by definition in
+		 * the LI_LIMITED state.
+		 */
+		resume_listener(listener);
+	}
+}
+
 /* Must be called with the lock held. Depending on <do_close> value, it does
  * what unbind_listener or unbind_listener_no_close should do.
  */
@@ -1036,12 +1049,11 @@
 		resume_listener(l);
 
 		/* Dequeues all of the listeners waiting for a resource */
-		if (!MT_LIST_ISEMPTY(&global_listener_queue))
-			dequeue_all_listeners(&global_listener_queue);
+		dequeue_all_listeners();
 
 		if (p && !MT_LIST_ISEMPTY(&p->listener_queue) &&
 		    (!p->fe_sps_lim || freq_ctr_remain(&p->fe_sess_per_sec, p->fe_sps_lim, 0) > 0))
-			dequeue_all_listeners(&p->listener_queue);
+			dequeue_proxy_listeners(p);
 	}
 
 	/* Now it's getting tricky. The listener was supposed to be in LI_READY
@@ -1104,12 +1116,11 @@
 		resume_listener(l);
 
 	/* Dequeues all of the listeners waiting for a resource */
-	if (!MT_LIST_ISEMPTY(&global_listener_queue))
-		dequeue_all_listeners(&global_listener_queue);
+	dequeue_all_listeners();
 
 	if (!MT_LIST_ISEMPTY(&fe->listener_queue) &&
 	    (!fe->fe_sps_lim || freq_ctr_remain(&fe->fe_sess_per_sec, fe->fe_sps_lim, 0) > 0))
-		dequeue_all_listeners(&fe->listener_queue);
+		dequeue_proxy_listeners(fe);
 }
 
 /* resume listeners waiting in the local listener queue. They are still in LI_LIMITED state */