Fix flags_test flakiness

The tests could run in parallel and step on eachothers logic by
setting/resetting global properties.

Revamp the logic to generate unique property names using scratch
files to prevent collisions.

Test: gtest
Bug: 190150217
Bug: 181748174
Change-Id: If870478e13dcfa2487da57b223b322847e702ea2
diff --git a/libartbase/base/flags.h b/libartbase/base/flags.h
index ae166e6..973a5da 100644
--- a/libartbase/base/flags.h
+++ b/libartbase/base/flags.h
@@ -140,7 +140,7 @@
   // Create a new Flag. The name parameter is used to generate the names from the various parameter
   // sources. See the documentation on the Flags struct for an example.
   explicit Flag(const std::string& name, Value default_value = {});
-  virtual ~Flag() {}
+  virtual ~Flag();
 
 
   // Returns the flag value.
@@ -190,7 +190,7 @@
   std::optional<Value> from_system_property_;
   std::optional<Value> from_server_setting_;
 
-  friend class FlagsTests;
+  friend class TestFlag;
 };
 
 // This struct contains the list of ART flags. Flags are parameterized by the type of value they