MINOR: quic_sock: index li->per_thr[] on local thread id, not global one

There's a li_per_thread array in each listener for use with QUIC
listeners. Since thread groups were introduced, this array can be
allocated too large because global.nbthread is allocated for each
listener, while only no more than MIN(nbthread,MAX_THREADS_PER_GROUP)
may be used by a single listener. This was because the global thread
ID is used as the index instead of the local ID (since a listener may
only be used by a single group). Let's just switch to local ID and
reduce the allocated size.
diff --git a/include/haproxy/listener-t.h b/include/haproxy/listener-t.h
index 0f6adde..f45c990 100644
--- a/include/haproxy/listener-t.h
+++ b/include/haproxy/listener-t.h
@@ -246,7 +246,7 @@
 		struct eb32_node id;	/* place in the tree of used IDs */
 	} conf;				/* config information */
 
-	struct li_per_thread *per_thr;  /* per-thread fields */
+	struct li_per_thread *per_thr;  /* per-thread fields (one per thread in the group) */
 
 	EXTRA_COUNTERS(extra_counters);
 };
diff --git a/src/listener.c b/src/listener.c
index ad72c8e..d6e58ce 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -205,19 +205,21 @@
 
 #endif // USE_THREAD
 
-/* Memory allocation and initialization of the per_thr field.
+/* Memory allocation and initialization of the per_thr field (one entry per
+ * bound thread).
  * Returns 0 if the field has been successfully initialized, -1 on failure.
  */
 int li_init_per_thr(struct listener *li)
 {
+	int nbthr = MIN(global.nbthread, MAX_THREADS_PER_GROUP);
 	int i;
 
 	/* allocate per-thread elements for listener */
-	li->per_thr = calloc(global.nbthread, sizeof(*li->per_thr));
+	li->per_thr = calloc(nbthr, sizeof(*li->per_thr));
 	if (!li->per_thr)
 		return -1;
 
-	for (i = 0; i < global.nbthread; ++i) {
+	for (i = 0; i < nbthr; ++i) {
 		MT_LIST_INIT(&li->per_thr[i].quic_accept.list);
 		MT_LIST_INIT(&li->per_thr[i].quic_accept.conns);
 
diff --git a/src/quic_sock.c b/src/quic_sock.c
index d7d4098..196ad38 100644
--- a/src/quic_sock.c
+++ b/src/quic_sock.c
@@ -147,7 +147,7 @@
 struct connection *quic_sock_accept_conn(struct listener *l, int *status)
 {
 	struct quic_conn *qc;
-	struct li_per_thread *lthr = &l->per_thr[tid];
+	struct li_per_thread *lthr = &l->per_thr[ti->ltid];
 
 	qc = MT_LIST_POP(&lthr->quic_accept.conns, struct quic_conn *, accept_list);
 	if (!qc || qc->flags & (QUIC_FL_CONN_CLOSING|QUIC_FL_CONN_DRAINING))
@@ -897,7 +897,7 @@
 void quic_accept_push_qc(struct quic_conn *qc)
 {
 	struct quic_accept_queue *queue = &quic_accept_queues[tid];
-	struct li_per_thread *lthr = &qc->li->per_thr[tid];
+	struct li_per_thread *lthr = &qc->li->per_thr[ti->ltid];
 
 	/* early return if accept is already in progress/done for this
 	 * connection