Don't count closed inherited file descriptors
Programs which close some inherited file descriptors and are run under
valgrind with -q and --track-fds=yes would still show the FILE
DESCRIPTORS banner even if there were no non-inherited file
descriptors still open.
Fix this by not counting already closed inherited file descriptors.
Add a simple testcase to show /usr/bin/cat /dev/null doesn't produce
any output running under valgrind -q --track-fds=yes.
https://bugs.kde.org/show_bug.cgi?id=504177
(cherry picked from commit
29a5fcb3f6371584f89f9b54c793cc0f29802553)