bindings: add spawn_sync bindings

This implements a nested event loop that makes it possible to control
a child process, while blocking the main loop until the process exits.
child_process: js bits for spawnSync/execSync

This implements the user-facing APIs that lets one run a child process
and block until it exits.

Some logic that these new functions had in common with the existing
spawn/exec/execFile implementation was refactored into separate
functions, so it could be shared.

Docs and tests are included.