Use file magic to determine file type, not file extension.

Bug: 10614658
Change-Id: I9156dfca78ac8cd1c62fb258825cc791629270a4
diff --git a/runtime/zip_archive.cc b/runtime/zip_archive.cc
index c3167e5..8e09e78 100644
--- a/runtime/zip_archive.cc
+++ b/runtime/zip_archive.cc
@@ -336,11 +336,11 @@
     PLOG(WARNING) << "Unable to open '" << filename << "'";
     return NULL;
   }
-  SetCloseOnExec(fd);
   return OpenFromFd(fd);
 }
 
 ZipArchive* ZipArchive::OpenFromFd(int fd) {
+  SetCloseOnExec(fd);
   UniquePtr<ZipArchive> zip_archive(new ZipArchive(fd));
   if (zip_archive.get() == NULL) {
       return NULL;