COMP: A more robust way to check file descriptor leaks

This patch counts the number of used file descriptors before and after
the I/O.

Change-Id: I94fbb66ce069f7f4f4d498a1ed54f9114eed2888
Merge topic 'AdjustFileDescriptorLimit' into master

ab29d100 COMP: A more robust way to check file descriptor leaks