Make sure incoming thread is interrupted when closing connection.