Added logger and bug fixes

We have to close the connection on a read failure which can leave
outstanding request (timeouts). That means we can’t delete the
connection in the close callback.