fix thread mask inheritance
properly restore uninterruptible mask after handling an exception
support building native executables with GHCJS and some extra command line options