Ensure no stdout output is lost

Fix for issue #120

See https://github.com/joyent/node/issues/3737 for more info