JS: mode flags in stat struct are different across host platforms
jsbits/base.js, we fill the
h$fs.constants to test the file type bits, which match the ones from the host platform.
But some Haskell code accesses the mode bits directly, using an
System/Posix/Files/Common.hsc, and that gives the wrong filetypes on macOS.
Fix: we should convert the mode field before inserting it in the struct stat to match the values that the C compiler accepts.