MINOR: tcp: add support for defer-accept on FreeBSD.

FreeBSD has a kernel feature (accf) and a sockopt flag similar to the
Linux's TCP_DEFER_ACCEPT to filter incoming data upon ACK. The main
difference is the filter needs to be placed when the socket actually
listens.
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index a534153..53569a9 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -708,6 +708,18 @@
 		goto tcp_close_return;
 	}
 
+#if !defined(TCP_DEFER_ACCEPT) && defined(SO_ACCEPTFILTER)
+	/* the socket needs to listen first */
+	if (listener->options & LI_O_DEF_ACCEPT) {
+		struct accept_filter_arg accept;
+		memset(&accept, 0, sizeof(accept));
+		strcpy(accept.af_name, "dataready");
+		if (setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &accept, sizeof(accept)) == -1) {
+			msg = "cannot enable ACCEPT_FILTER";
+			err |= ERR_WARN;
+		}
+	}
+#endif
 #if defined(TCP_QUICKACK)
 	if (listener->options & LI_O_NOQUICKACK)
 		setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &zero, sizeof(zero));