Protect the error log in QuicAlarm::~QuicAlarm with --gfe2_restart_flag_quic_alarm_add_permanent_cancel.

QUIC_LOG_EVERY_N_SEC is not actually rate limited in Chromium, in net_unittest, repeatedly triggering this log could cause test timeouts.

No other behavior change other than the error log.

Protected by FLAGS_quic_restart_flag_quic_alarm_add_permanent_cancel.

PiperOrigin-RevId: 388521799
diff --git a/quic/core/quic_alarm.cc b/quic/core/quic_alarm.cc
index 75f7dc5..d49fb92 100644
--- a/quic/core/quic_alarm.cc
+++ b/quic/core/quic_alarm.cc
@@ -14,7 +14,7 @@
     : delegate_(std::move(delegate)), deadline_(QuicTime::Zero()) {}
 
 QuicAlarm::~QuicAlarm() {
-  if (IsSet()) {
+  if (GetQuicRestartFlag(quic_alarm_add_permanent_cancel) && IsSet()) {
     QUIC_LOG_EVERY_N_SEC(ERROR, 10 * 60)
         << "QuicAlarm not cancelled at destruction. This message is rate "
            "limited to once every 10 minutes. "