Fix client-side HTTP hijacking over TLS

Properly CloseWrite() the client socket once done with stdin when using
TLS connection (this used to rely on an erroneous type assertion).

Fixes #8658.
Fixes #8642.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: Michael Crosby <crosby.michael@gmail.com>

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com> (github: jfrazelle)
Bump version to v1.4.0

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)