Fix -verbose:image errors

Error 1: Deferencing empty space array
Error 2: Calling DumpTiming before the scoped split is closed.

Fixe device booting with -verbose:image enabled.

Bug: 116059983
Bug: 77856493
Test: test-art-host
Test: manual
Change-Id: I8389019e1430db736e84c2670e4c2d1499b23c1a
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index 16359ac..8ba8e33 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -429,9 +429,9 @@
                image_header->GetImageMethod(ImageHeader::kSaveEverythingMethodForSuspendCheck));
 
       VLOG(image) << "ImageSpace::Loader::InitAppImage exiting " << *space.get();
-      if (VLOG_IS_ON(image)) {
-        logger.Dump(LOG_STREAM(INFO));
-      }
+    }
+    if (VLOG_IS_ON(image)) {
+      logger.Dump(LOG_STREAM(INFO));
     }
     return space;
   }
@@ -1396,9 +1396,9 @@
     MaybeRelocateSpaces(spaces, &logger);
     InitRuntimeMethods(spaces);
     *extra_reservation = std::move(local_extra_reservation);
+    VLOG(image) << "ImageSpace::BootImageLoader::InitFromDalvikCache exiting " << *spaces.front();
     boot_image_spaces->swap(spaces);
 
-    VLOG(image) << "ImageSpace::BootImageLoader::InitFromDalvikCache exiting " << *spaces.front();
     if (VLOG_IS_ON(image)) {
       logger.Dump(LOG_STREAM(INFO));
     }