Check for a NULL pointer, do not call Build.

When calling BacktraceMap::Create(), a NULL pointer is returned if Build
fails. Building twice can cause problems and might leak memory.

(cherry picked from commit 836572a07142627ff291d686a4e9e03a0988344b)

Change-Id: I59d29bb6e5324de6eb099916045c2ab1d9e56630
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index 6c7ee5b..c281b22 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -135,7 +135,7 @@
                              uintptr_t end,
                              std::string* error_msg) {
   std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(getpid(), true));
-  if (!map->Build()) {
+  if (map.get() == nullptr) {
     *error_msg = StringPrintf("Failed to build process map");
     return false;
   }
@@ -158,7 +158,7 @@
                                 uintptr_t end,
                                 std::string* error_msg) {
   std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(getpid(), true));
-  if (!map->Build()) {
+  if (map.get() == nullptr) {
     *error_msg = StringPrintf("Failed to build process map");
     return false;
   }