Fix logger use after free

Nodes() points to invalid nodes every time you call RemapLoggedChannel.
Use the logged configuration instead, which is not being destroyed.

Change-Id: Id8f0efc6ac3611fa70a812bb396ef3151919ced2
diff --git a/aos/configuration.cc b/aos/configuration.cc
index f466ee0..f68c543 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -803,6 +803,8 @@
   if (node == nullptr) {
     return true;
   }
+  CHECK(channel->has_source_node()) << FlatbufferToJson(channel);
+  CHECK(node->has_name()) << FlatbufferToJson(node);
   return (CHECK_NOTNULL(channel)->source_node()->string_view() ==
           node->name()->string_view());
 }
diff --git a/aos/events/logging/logger.cc b/aos/events/logging/logger.cc
index 19a0229..33d2abb 100644
--- a/aos/events/logging/logger.cc
+++ b/aos/events/logging/logger.cc
@@ -876,7 +876,7 @@
 
   // Remap all existing remote timestamp channels.  They will be recreated, and
   // the data logged isn't relevant anymore.
-  for (const Node *node : Nodes()) {
+  for (const Node *node : configuration::GetNodes(logged_configuration())) {
     std::vector<const Node *> timestamp_logger_nodes =
         configuration::TimestampNodes(logged_configuration(), node);
     for (const Node *remote_node : timestamp_logger_nodes) {