Fix connection closed bug

Fix a bug where the connection would be incorrectly labelled as closed after a
read timeout.