client: exit hijack when the output goroutine exits

The previous approach would wait for the input goroutine to exit as
well. This would let to the problem described in the issue #117.

Fixes #117.