check if fd is a valid descriptor