MINOR: listener: introduce listener_backlog() to report the backlog value

In an attempt to try to provide automatic maxconn settings, we need to
decorrelate a listner's backlog and maxconn so that these values can be
independent. This introduces a listener_backlog() function which retrieves
the backlog value from the listener's backlog, the frontend's, the
listener's maxconn, the frontend's or falls back to 1024. This
corresponds to what was done in cfgparse.c to force a value there except
the last fallback which was not set since the frontend's maxconn is always
known.
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 28b7750..f1a0e4c 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1017,7 +1017,7 @@
 #if defined(TCP_FASTOPEN)
 	if (listener->options & LI_O_TCP_FO) {
 		/* TFO needs a queue length, let's use the configured backlog */
-		int qlen = listener->backlog ? listener->backlog : listener->maxconn;
+		int qlen = listener_backlog(listener);
 		if (setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, &qlen, sizeof(qlen)) == -1) {
 			msg = "cannot enable TCP_FASTOPEN";
 			err |= ERR_WARN;
@@ -1058,7 +1058,7 @@
 		ready = 0;
 
 	if (!(ext && ready) && /* only listen if not already done by external process */
-	    listen(fd, listener->backlog ? listener->backlog : listener->maxconn) == -1) {
+	    listen(fd, listener_backlog(listener)) == -1) {
 		err |= ERR_RETRYABLE | ERR_ALERT;
 		msg = "cannot listen to socket";
 		goto tcp_close_return;
@@ -1150,7 +1150,7 @@
 	if (shutdown(l->fd, SHUT_WR) != 0)
 		return -1; /* Solaris dies here */
 
-	if (listen(l->fd, l->backlog ? l->backlog : l->maxconn) != 0)
+	if (listen(l->fd, listener_backlog(l)) != 0)
 		return -1; /* OpenBSD dies here */
 
 	if (shutdown(l->fd, SHUT_RD) != 0)