JS: Some fixes for IO and streams (#22349)

Closed Luite Stegeman requested to merge luite/ghc:fix-process into master

This fixes

  • threads always stuck in uninterruptibleMask when in blocked IO (async exceptions should still be used with caution)
  • stdin handler installed on startup affects file descriptor for other uses
  • reserve one more 'virtual' file descriptor (for upcoming process package support)

Merge request reports