Fix leaked threads in client-server test.