Pipe a node.js stream into a buffer (with memory limit, error handling)