MEDIUM: threads/server: Make connection list (priv/idle/safe) thread-safe

For now, we have a list of each type per thread. So there is no need to lock
them. This is the easiest solution for now, but not the best one because there
is no sharing between threads. An idle connection on a thread will not be able
be used by a stream on another thread. So it could be a good idea to rework this
patch later.
diff --git a/src/backend.c b/src/backend.c
index 475efa3..5e51f39 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1066,20 +1066,19 @@
 		 *  idle|  -  |  1  |    idle|  -  |  1  |   idle|  2  |  1  |
 		 *  ----+-----+-----+    ----+-----+-----+   ----+-----+-----+
 		 */
-
-		if (!LIST_ISEMPTY(&srv->idle_conns) &&
+		if (srv->idle_conns && !LIST_ISEMPTY(&srv->idle_conns[tid]) &&
 		    ((s->be->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR &&
 		     s->txn && (s->txn->flags & TX_NOT_FIRST))) {
-			srv_conn = LIST_ELEM(srv->idle_conns.n, struct connection *, list);
+			srv_conn = LIST_ELEM(srv->idle_conns[tid].n, struct connection *, list);
 		}
-		else if (!LIST_ISEMPTY(&srv->safe_conns) &&
+		else if (srv->safe_conns && !LIST_ISEMPTY(&srv->safe_conns[tid]) &&
 			 ((s->txn && (s->txn->flags & TX_NOT_FIRST)) ||
 			  (s->be->options & PR_O_REUSE_MASK) >= PR_O_REUSE_AGGR)) {
-			srv_conn = LIST_ELEM(srv->safe_conns.n, struct connection *, list);
+			srv_conn = LIST_ELEM(srv->safe_conns[tid].n, struct connection *, list);
 		}
-		else if (!LIST_ISEMPTY(&srv->idle_conns) &&
+		else if (srv->idle_conns && !LIST_ISEMPTY(&srv->idle_conns[tid]) &&
 			 (s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS) {
-			srv_conn = LIST_ELEM(srv->idle_conns.n, struct connection *, list);
+			srv_conn = LIST_ELEM(srv->idle_conns[tid].n, struct connection *, list);
 		}
 
 		/* If we've picked a connection from the pool, we now have to