Allow attaching to stdin separately from stdout and stderr

To solve #234 we need a way to attach stdin separately from stdout and stderr.