lib: be robust when process global is clobbered
Program bugs sometimes happen to overwrite the process
global object,
leading to unpredictable runtime errors. The bug is often hard to track
down because the crash usually looks unrelated and happens far away from
the bug point.
Make core mostly immune to such corruption by ensuring that all core modules close over a direct reference to the process object instead of a dynamic reference.