Handle d_type == DT_UNKNOWN correctly
As documented in the man-page, readdir() may return a directory entry with
d_type == DT_UNKNOWN. This must be handled for regular filesystems.
dirent_ensure_type() is available to set d_type if necessary. Use it in
some more places.
Without this systemd will fail to boot correctly with nfsroot and some
other filesystems.
Closes #13609
(cherry picked from commit
28e68bb23547cbc11cd3f62a1a38dbe2b387b370)
(cherry picked from commit
5c0224c7bf3c4b0f18d44ee9da7e058833b1d8e2)
Gbp-Pq: Name Handle-d_type-DT_UNKNOWN-correctly.patch