More accurate check of file descriptors