Fix use after free in logger_main with --rotate_every

We were saving it in a lambda and then exiting the scope.  Move the
scope out.

Change-Id: Iecf83f46659d7eb3b6a84b1c27dbe131d20d69d7
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/events/logging/logger_main.cc b/aos/events/logging/logger_main.cc
index b56f977..526eb31 100644
--- a/aos/events/logging/logger_main.cc
+++ b/aos/events/logging/logger_main.cc
@@ -45,11 +45,11 @@
         []() { return std::make_unique<aos::logger::SnappyEncoder>(); });
   }
 
+  aos::monotonic_clock::time_point last_rotation_time =
+      event_loop.monotonic_now();
   aos::logger::Logger logger(&event_loop);
 
   if (FLAGS_rotate_every != 0.0) {
-    aos::monotonic_clock::time_point last_rotation_time =
-        event_loop.monotonic_now();
     logger.set_on_logged_period([&] {
       const auto now = event_loop.monotonic_now();
       if (now > last_rotation_time +