Closes the client.
If there are in-flight requests, they will be allowed to complete. However, no new requests will be accepted.