Check attached

Hello,

Thanks for the work to make dockerpty work without the tty :)

I noticed however, that it will quit if you enter anything on stdin.

So I've got a change here to only hijack the tty for the streams that are set to be attached in the config for the container.
I'm not clear why this is needed, unless you are defensively assuming the assignment inside the `try` may fail. Am I missing something?