Remove thread-blocking call to `libc::stat` in `Path::stat`

Fixes #9958