Make forkProcess exception-safe.

Before this patch, killing a process while it was terminating could
leave the `LocalNode` in an inconsistent state if an async exception is
thrown.

Bug originally spotted by Facundo Domínguez.