Part 2 to making forkProcess exception-safe.

The previous patch fixed exception safety inside the exception handlers
of the spawned process. This time, we prevent exceptions from causing
resources (such as processes) to leak if the caller `forkProcess` itself
receives an exception (note that the caller is not always the node
agent thread).
Replacement for modifyMVarMasked for GHC <= 7.4.
Merge branch 'master' of git://github.com/haskell-distributed/distributed-process