Fix mmap leak in MmapFile

If the mmap'ed file doesn't end in a new line, previously we'd leak
the mmap'ed region.  This change now munmap's the region.

Test: unit tests
Change-Id: If28d3d9a6b1b9c54123beecb3bbbe8ed984ca81d
diff --git a/libc/bionic/grp_pwd_file.cpp b/libc/bionic/grp_pwd_file.cpp
index 911daea..4b8b8a9 100644
--- a/libc/bionic/grp_pwd_file.cpp
+++ b/libc/bionic/grp_pwd_file.cpp
@@ -233,7 +233,7 @@
 
   auto mmap_size = fd_stat.st_size;
 
-  const void* map_result = mmap(nullptr, mmap_size, PROT_READ, MAP_SHARED, fd, 0);
+  void* map_result = mmap(nullptr, mmap_size, PROT_READ, MAP_SHARED, fd, 0);
   close(fd);
 
   if (map_result == MAP_FAILED) {
@@ -243,7 +243,12 @@
   start_ = static_cast<const char*>(map_result);
   end_ = start_ + mmap_size - 1;
 
-  return *end_ == '\n';
+  if (*end_ != '\n') {
+    munmap(map_result, mmap_size);
+    return false;
+  }
+
+  return true;
 }
 
 template <typename Line, typename Predicate>