Use `stat` instead of `lstat` to support symlinks