MEDIUM: connection: Add private connections synchronously in session server list

When a connection is marked as private, it is now added in the session server
list. We don't wait a stream is detached from the mux to do so. When the
connection is created, this happens after the mux creation. Otherwise, it is
performed when the connection is marked as private.

To allow that, when a connection is created, the session is systematically set
as the connectin owner. Thus, a backend connection has always a owner during its
creation. And a private connection has always a owner until its death.

Note that outside the detach() callback, if the call to session_add_conn()
failed, the error is ignored. In this situation, we retry to add the connection
into the session server list in the detach() callback. If this fails at this
step, the multiplexer is destroyed and the connection is closed.
diff --git a/src/backend.c b/src/backend.c
index c83371e..f346af5 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1402,6 +1402,7 @@
 			srv_conn->target = s->target;
 		srv_cs = NULL;
 
+		srv_conn->owner = s->sess;
 		if ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_NEVR)
 			conn_set_private(srv_conn);
 	}
@@ -1466,10 +1467,7 @@
 		    srv->mux_proto || s->be->mode != PR_MODE_HTTP))
 #endif
 			init_mux = 1;
-#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
-		else
-			srv_conn->owner = s->sess;
-#endif
+
 		/* process the case where the server requires the PROXY protocol to be sent */
 		srv_conn->send_proxy_ofs = 0;
 
@@ -1547,11 +1545,17 @@
 		}
 		/* If we're doing http-reuse always, and the connection is not
 		 * private with available streams (an http2 connection), add it
-		 * to the available list, so that others can use it right away.
+		 * to the available list, so that others can use it right
+		 * away. If the connection is private, add it in the session
+		 * server list.
 		 */
 		if (srv && ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS) &&
 		    !(srv_conn->flags & CO_FL_PRIVATE) && srv_conn->mux->avail_streams(srv_conn) > 0)
 			LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&srv_conn->list));
+		else if (srv_conn->flags & CO_FL_PRIVATE) {
+			/* If it fail now, the same will be done in mux->detach() callack */
+			session_add_conn(srv_conn->owner, srv_conn, srv_conn->target);
+		}
 	}
 	/* The CO_FL_SEND_PROXY flag may have been set by the connect method,
 	 * if so, add our handshake pseudo-XPRT now.