[LifetimeAnalysis] Fix potential breakages for PruneTriviallyFalseEdges

Change some tests not to use the constant boolean value for conditionals
so that the analysis (correctly) takes care of the both branches even if
unreachable nodes are pruned.

Also make a few fixes not to crash when PruneTriviallyFalseEdges is set
to true.

This is a preparation for landing https://reviews.llvm.org/D149640

PiperOrigin-RevId: 529029325
diff --git a/lifetime_analysis/analyze.cc b/lifetime_analysis/analyze.cc
index 0843585..b6dce4e 100644
--- a/lifetime_analysis/analyze.cc
+++ b/lifetime_analysis/analyze.cc
@@ -347,7 +347,9 @@
   }
 
   for (const clang::CFGBlock* block : cfg) {
-    for (const clang::CFGBlock* succ : block->succs()) {
+    if (!block) continue;
+    for (const auto& succ : block->succs()) {
+      if (!succ.isReachable()) continue;
       absl::StrAppendFormat(
           &result,
           "B%1$usink -> B%2$usource [ltail=cluster%1$u,lhead=cluster%2$u];\n",