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

Fixes #9958
auto merge of #10022 : hatahet/rust/master, r=alexcrichton

Fixes #9958