Don't set shutdown_in_progress too early