Test that client shuts down gracefully