Fix Panic with -t and -a stderr

Fixes #6983

At present, running docker with the -t and -a stderr flags (but no -a stdout) causes a panic. Adding a check to terminal hijack to ensure io.Copy is only used if STDOUT is attached fixes this.

Tested with all combinations of -a std(out|err|in) and -t, no regressions I can find.
If stdout is nil, we fall back to utils.StdCopy() instead of io.Copy, which doesn't seem to have an issue dealing with a nil stdout - running 'docker run' with stderr attached, but stdout not attached, is perfectly fine after this patch