If PrepareForShutdown fires while Supervisor is still starting up,
wait for startup to complete before running the graceful shutdown
sequence. This prevents shutting down partially initialized
containers and services.
The _startup_complete event is set automatically in set_state()
whenever state transitions to RUNNING. If SIGTERM arrives during
startup, core.stop() cancels the monitor task via host.unload(),
cleanly interrupting the wait.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>