Offload functions to worker threads with shared memory primitives for Node.js.

fix: reject peer connects arriving after shutdown instead of hanging the drain master