Make forkProcess exception-safe.

Before this patch, killing a process while it was terminating could leave the Node state inconsistent.