MAJOR: acl: make acl_find_targets also resolve proxy names at config time

Proxy names are now resolved when the config is parsed and not at runtime.
This means that errors will be caught for real instead of having an ACL
silently never match. Another benefit is that the fetch will be much faster
since the lookup will not have to be performed anymore, eg for all ACLs
based on explicitly named stick-tables.

However some buggy configurations which used to silently fail in the past
will now refuse to load, hence the MAJOR tag.
diff --git a/src/backend.c b/src/backend.c
index 43e1cef..fd2528f 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1378,7 +1378,7 @@
 /************************************************************************/
 
 /* set temp integer to the number of enabled servers on the proxy.
- * Accepts either 0 or 1 argument. Argument is a string, other types will lead to
+ * Accepts either 0 or 1 argument. Argument is a backend, other types will lead to
  * undefined behaviour.
  */
 static int
@@ -1386,14 +1386,8 @@
                 struct acl_expr *expr, struct acl_test *test)
 {
 	test->flags = ACL_TEST_F_VOL_TEST;
-	if (expr->args) {
-		/* another proxy was designated, we must look for it */
-		for (px = proxy; px; px = px->next)
-			if ((px->cap & PR_CAP_BE) && !strcmp(px->id, expr->args->data.str.str))
-				break;
-	}
-	if (!px)
-		return 0;
+	if (expr->args)
+		px = expr->args->data.prx;
 
 	if (px->srv_act)
 		temp_pattern.data.integer = px->srv_act;
@@ -1426,7 +1420,7 @@
 }
 
 /* set temp integer to the number of enabled servers on the proxy.
- * Accepts either 0 or 1 argument. Argument is a string, other types will lead to
+ * Accepts either 0 or 1 argument. Argument is a backend, other types will lead to
  * undefined behaviour.
  */
 static int
@@ -1434,15 +1428,10 @@
 		    struct acl_expr *expr, struct acl_test *test)
 {
 	struct server *iterator;
+
 	test->flags = ACL_TEST_F_VOL_TEST;
-	if (expr->args) {
-		/* another proxy was designated, we must look for it */
-		for (px = proxy; px; px = px->next)
-			if ((px->cap & PR_CAP_BE) && !strcmp(px->id, expr->args->data.str.str))
-				break;
-	}
-	if (!px)
-		return 0;
+	if (expr->args)
+		px = expr->args->data.prx;
 
 	temp_pattern.data.integer = 0;
 	iterator = px->srv;
@@ -1491,7 +1480,7 @@
 }
 
 /* set temp integer to the number of connections per second reaching the backend.
- * Accepts either 0 or 1 argument. Argument is a string, other types will lead to
+ * Accepts either 0 or 1 argument. Argument is a backend, other types will lead to
  * undefined behaviour.
  */
 static int
@@ -1499,21 +1488,15 @@
                        struct acl_expr *expr, struct acl_test *test)
 {
 	test->flags = ACL_TEST_F_VOL_TEST;
-	if (expr->args) {
-		/* another proxy was designated, we must look for it */
-		for (px = proxy; px; px = px->next)
-			if ((px->cap & PR_CAP_BE) && !strcmp(px->id, expr->args->data.str.str))
-				break;
-	}
-	if (!px)
-		return 0;
+	if (expr->args)
+		px = expr->args->data.prx;
 
 	temp_pattern.data.integer = read_freq_ctr(&px->be_sess_per_sec);
 	return 1;
 }
 
 /* set temp integer to the number of concurrent connections on the backend.
- * Accepts either 0 or 1 argument. Argument is a string, other types will lead to
+ * Accepts either 0 or 1 argument. Argument is a backend, other types will lead to
  * undefined behaviour.
  */
 static int
@@ -1521,21 +1504,15 @@
 		  struct acl_expr *expr, struct acl_test *test)
 {
 	test->flags = ACL_TEST_F_VOL_TEST;
-	if (expr->args) {
-		/* another proxy was designated, we must look for it */
-		for (px = proxy; px; px = px->next)
-			if ((px->cap & PR_CAP_BE) && !strcmp(px->id, expr->args->data.str.str))
-				break;
-	}
-	if (!px)
-		return 0;
+	if (expr->args)
+		px = expr->args->data.prx;
 
 	temp_pattern.data.integer = px->beconn;
 	return 1;
 }
 
 /* set temp integer to the total number of queued connections on the backend.
- * Accepts either 0 or 1 argument. Argument is a string, other types will lead to
+ * Accepts either 0 or 1 argument. Argument is a backend, other types will lead to
  * undefined behaviour.
  */
 static int
@@ -1543,14 +1520,8 @@
 		   struct acl_expr *expr, struct acl_test *test)
 {
 	test->flags = ACL_TEST_F_VOL_TEST;
-	if (expr->args) {
-		/* another proxy was designated, we must look for it */
-		for (px = proxy; px; px = px->next)
-			if ((px->cap & PR_CAP_BE) && !strcmp(px->id, expr->args->data.str.str))
-				break;
-	}
-	if (!px)
-		return 0;
+	if (expr->args)
+		px = expr->args->data.prx;
 
 	temp_pattern.data.integer = px->totpend;
 	return 1;
@@ -1561,7 +1532,7 @@
  * server, we return twice the total, just as if we had half a running server.
  * This is more or less correct anyway, since we expect the last server to come
  * back soon.
- * Accepts either 0 or 1 argument. Argument is a string, other types will lead to
+ * Accepts either 0 or 1 argument. Argument is a backend, other types will lead to
  * undefined behaviour.
  */
 static int
@@ -1571,14 +1542,8 @@
 	int nbsrv;
 
 	test->flags = ACL_TEST_F_VOL_TEST;
-	if (expr->args) {
-		/* another proxy was designated, we must look for it */
-		for (px = proxy; px; px = px->next)
-			if ((px->cap & PR_CAP_BE) && !strcmp(px->id, expr->args->data.str.str))
-				break;
-	}
-	if (!px)
-		return 0;
+	if (expr->args)
+		px = expr->args->data.prx;
 
 	if (px->srv_act)
 		nbsrv = px->srv_act;