improve handling of dirents without d_type set