generic/401: fix test in case of no filetype support
Xu Huan reported that this test fails on nfs in some setup.
Apparently, the assumptions made about xfs/ext* do not hold
for nfs.
Relax the verification of filetype not supported case to
allow either DT_UNKNOWN or actual file type on all files and
not only on special dir entires "." and "..".
Convert the unknown d_type replacement code from awk to bash
so it is a bit more readable and flexible.