BUG/MEDIUM: servers: Add a per-thread counter of idle connections.

Add a per-thread counter of idling connections, and use it to determine
how many connections we should kill after the timeout, instead of using
the global counter, or we're likely to just kill most of the connections.

This should be backported to 1.9.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index 1dc0512..45b8a8a 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -694,6 +694,7 @@
 	if (conn->idle_time > 0) {
 		struct server *srv = __objt_server(conn->target);
 		HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
+		srv->curr_idle_thr[tid]--;
 	}
 
 	conn_force_unsubscribe(conn);
diff --git a/include/proto/server.h b/include/proto/server.h
index 51d1015..9467f69 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -253,6 +253,7 @@
 		}
 		LIST_DEL(&conn->list);
 		LIST_ADDQ(&srv->idle_orphan_conns[tid], &conn->list);
+		srv->curr_idle_thr[tid]++;
 
 		conn->idle_time = now_ms;
 		if (!(task_in_wq(srv->idle_task[tid])) &&