Try to narrow down used fds. Refs #5878.
Merge pull request #6044 from s0undt3ch/issues/5878-file-descriptors-leak

Try to narrow down used fds. Refs #5878.