dex2oat: Expect boot image profiles for boot image.

The profile loading is currently permissive, so this
does not really matter but we intend to make it more
strict soon.

Also clean up ScratchFile to avoid dex2oat_image_test
error logs related to ScratchFile destruction.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 148067697
Change-Id: I34526ddb0389444d54b9754afbedeb671c7b05a8
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index cc23620..cc347a1 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -174,7 +174,15 @@
   void GenerateProfile(ArrayRef<const std::string> dexes,
                        File* out_file,
                        size_t method_frequency = 1u,
-                       size_t type_frequency = 1u);
+                       size_t type_frequency = 1u,
+                       bool for_boot_image = false);
+  void GenerateBootProfile(ArrayRef<const std::string> dexes,
+                           File* out_file,
+                           size_t method_frequency = 1u,
+                           size_t type_frequency = 1u) {
+    return GenerateProfile(
+        dexes, out_file, method_frequency, type_frequency, /*for_boot_image=*/ true);
+  }
 
   std::unique_ptr<Runtime> runtime_;