Close connection on IO error