Fixing bug in AttachStreams that would fail to close StdIn Upstream-commit: c1dd933c029d425ad8f5c3787d9b591ca216e08f Component: engine