Android and possibly other UNIX systems lack getdtablesize() so let's try to use a better way of estimating the file descriptors we need to close post-fork, pre-exec by listing /proc/self/fd. If that fails, we fall back on getdtablesize or as a last resort a hard-coded 4096.