Add flock(2)ing on dex-cache files to prevent races

Bug: 9071417
Change-Id: I1ee9ff281867f90fba7a8ed8bbf06b33ac29d511
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 87cd21c..6856bb7 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -1229,6 +1229,7 @@
 
 bool IsValidOatFilename(const std::string& filename) {
   return (EndsWith(filename, ".odex") ||
+          EndsWith(filename, ".dex") ||
           EndsWith(filename, ".oat") ||
           EndsWith(filename, DexFile::kClassesDex));
 }