Fix crash in node and properly pipe streams.

This also fixes this issue: https://github.com/joyent/node/issues/7063