ensure all client threads get cancelled when shutting down the server