Fix struct stat under Linux.
Compute the directory length

    There can be padding at the end of the buffer for alignment.
    All we can rely on is the '\0' terminator.
Fix struct stat.

    We had the wrong types/sizes. especially for a 64 bit stat.
add lstat() syscall