Avoid potential libdispatch crash when we close its fds.
--- compat/closefrom.c.orig
+++ compat/closefrom.c
@@ -27,6 +27,7 @@
 #include <sys/time.h> /* for <sys/resource.h> */
 #include <sys/resource.h> /* getrlimit() */
 #include <unistd.h>
+#include <fcntl.h>
 #include <errno.h> /* errno */
 #include <sys/select.h> /* FD_SETSIZE */
 
@@ -74,7 +75,11 @@
 	}
 
 	while ((unsigned)fd < lim.rlim_max)
+#ifdef __APPLE__
+		if (fcntl (fd++, F_SETFD, FD_CLOEXEC) != -1)
+#else
 		if (close (fd++) == 0)
+#endif
 			found++;
 
 	if (found == 0)