Removed the setTimeout nonsense, and manually close child.stdin