Update configure check to emulate AC_HEADER_DIRENT

That way the variables HAVE_SYS_NDIR_H/HAVE_SYS_DIR_H/HAVE_NDIR_H
will set only if HAVE_DIRENT_H have not been set.

See http://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/Particular-Headers.html