Enforce process state vs. exit-action set atomicity.

This is a fairly major rework of process state and link/monitor/exit-hook
handling.