Account for already used file descriptors when computing max open files
Account for already used file descriptors when computing max open files

The process already has some existing file descriptors open, e.g. stdin,
stdout and stderr, so we can't assume we can open as many files as the
RLIMIT_NOFILE tells us.

A different approach to this is to not use a static limit of maximum
open files, but instead react to EMFILE when trying to open new files,
and then close existing files, but as a stop gap we compute a more
accurate static value for the maximum open files.

Fixes #35

torarnv/sparsebundlefs,torarnv/sparsebundlefs