Shutdown the client properly.