fix tail usage
fix HAVE_FDOPENDIR case
fix readdir_r on Solaris
fix initialization type of dir.bufsiz
no fdopendir on NetBSD 5.2
fix bug introduced when adding DIR* support to unixL_optfileno, and reset cursor when duplicating file descriptors in opendir