Handle absense of (struct dirent).d_type

*BSD and Linux implement this, but it's not required by POSIX and, e.g.,
Solaris/IllumOS don't support it.

Since we already have to deal with DT_UNKNOWN and call the stat stuff in
that case anyway, just do some autoconf and preprocessor magic to hide
the differences.

Should fix github.com issue#22.