JS: adapt to struct stat change (#23641)
"struct stat" changed its layout in recent Emscripten (they removed explicit padding fields). Detect the size of the struct at runtime to fill the fields appropriately.
This should support:
- offsets hard-wired in base:System.Posix.Internals
- offsets obtained through hsc2hs (with old and new headers)