Make stat, opendir, readdir, and closedir GC safe (#63943)
* Make stat ccalls GC-safe
Invoke stat calls via the new `@ccall gc_safe=true` macro.
GC safety is particularly important for stat calls, since slow filesystems are
common and can hang up GC, and thus every other thread in a safepoint, for a
long time.
* Make the directory reads behind `eachentry` GC-safe
Extend GC safety to the C code behind `eachentry`.