Fix Dir.statFile for WASI when linking libc
#17029
Merged
Dir.statFile for WASI when linking libc
#17029