Fix POSIX version of DirEntry_do_stat() and refactor a bit.