client.go: Error handling.

When the request is not properly formed, like missing image name, Docker just closes the connection without any response which results into a Panic, this will fix the issue. I will try to fill a bug upstream too, however, this fix is still required as the connection can be closed unexpectedly for a lot of reasons.