`fdopendir` takes ownership of a directory file descriptor instead of opening one with a path. `fdclosedir` is a FreeBSD extension that transfers ownership of the file descriptor in DIR to the user.
Signed-off-by: Anhad Singh <andypython@protonmail.com>