Handle client disconnect during tests.