unix_capture_directory(): Use readdir() instead of readdir_r()