* Add test cases for opendir() and fdopendir().
* Make fdopendir() fail early if the file descriptor is invalid or not
associated with a directory.
* Drop O_NONBLOCK from opendir(); it was added a long time ago to avoid
blocking if given a closed named pipe, but now we use O_DIRECTORY,
which ensures that we get ENOTDIR in that case.
* While here, remove unused #includes left over from the split.
Sponsored by: Klara, Inc.