[MEDIUM] frontend: count the incoming connection earlier

The frontend's connection was accounted for once the session was
instanciated. This was problematic because the early ACLs weren't
able to correctly account for the number of concurrent connections.
Now we count the connection once it is assigned to the frontend.
It also brings the nice advantage of being more symmetrical, because
the stream_sock's accept() does not have to account for that anymore,
only the session's accept() does.
diff --git a/src/stream_sock.c b/src/stream_sock.c
index 93e3daf..2d5ef6d 100644
--- a/src/stream_sock.c
+++ b/src/stream_sock.c
@@ -1184,6 +1184,15 @@
 			goto out_close;
 		}
 
+		actconn++;
+		totalconn++;
+		l->nbconn++;
+
+		if (l->counters) {
+			if (l->nbconn > l->counters->conn_max)
+				l->counters->conn_max = l->nbconn;
+		}
+
 		ret = l->accept(l, cfd, &addr);
 		if (unlikely(ret < 0)) {
 			/* critical error encountered, generally a resource shortage */
@@ -1191,32 +1200,22 @@
 				EV_FD_CLR(fd, DIR_RD);
 				p->state = PR_STIDLE;
 			}
+			actconn--;
+			l->nbconn--;
 			goto out_close;
 		}
 		else if (unlikely(ret == 0)) {
 			/* ignore this connection */
+			actconn--;
+			l->nbconn--;
 			close(cfd);
 			continue;
 		}
 
-		actconn++;
-		totalconn++;
-		l->nbconn++; /* warning! right now, it's up to the handler to decrease this */
 		if (l->nbconn >= l->maxconn) {
 			EV_FD_CLR(l->fd, DIR_RD);
 			l->state = LI_FULL;
 		}
-
-		if (p) {
-			p->feconn++;  /* beconn will be increased later */
-			if (p->feconn > p->counters.feconn_max)
-				p->counters.feconn_max = p->feconn;
-		}
-
-		if (l->counters) {
-			if (l->nbconn > l->counters->conn_max)
-				l->counters->conn_max = l->nbconn;
-		}
 	} /* end of while (p->feconn < p->maxconn) */
 	return 0;