Basic file locking.

If someone's already doing dex2oat, wait for them to finish rather
than duplicate their work.

Change-Id: Id620c75e013cbbcc84f5bf62a7629533a95307df
diff --git a/src/image_test.cc b/src/image_test.cc
index 2ef7489..3e64d95 100644
--- a/src/image_test.cc
+++ b/src/image_test.cc
@@ -18,7 +18,7 @@
 
 TEST_F(ImageTest, WriteRead) {
   ScratchFile tmp_oat;
-  bool success_oat = OatWriter::Create(tmp_oat.GetFilename(), NULL, *compiler_.get());
+  bool success_oat = OatWriter::Create(tmp_oat.GetFile(), NULL, *compiler_.get());
   ASSERT_TRUE(success_oat);
 
   ImageWriter writer;