TS-3106: Make sure to close connection on timeout