If someone does manage to connect while we are shutting down, close the connection. Also, check if the server already knows its stopped, rather than waiting on the connection. (It can take a second or so for the OS to say that it really cannot connect to a closed socket.)
There is one more failure now. Specifically: test_graceful_shutdown_waits_for_clients_to_stop. Because server._stop_gracefully() now tells client handlers to _stop_gracefully, and we don't actually have an active rpc in progress, the client can stop before we test that the server is waiting for it to stop.