Close connection when receiving fails

We might get a socket exception when when receiving from the client fails.
Handle that by shutting down the connection.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>