The client doesn't crash now when the server is closed.