Use libdemangle for function names.

Bug: 62141808

Test: Ran unit tests, ran malloc debug with leaks and verified functions
Test: are demangled.
Change-Id: I1900632e9a55bb818b1aabc798224ff3eebc1fca
diff --git a/libc/malloc_debug/backtrace.cpp b/libc/malloc_debug/backtrace.cpp
index 907944f..2443ba1 100644
--- a/libc/malloc_debug/backtrace.cpp
+++ b/libc/malloc_debug/backtrace.cpp
@@ -36,6 +36,8 @@
 #include <unistd.h>
 #include <unwind.h>
 
+#include <demangle.h>
+
 #include "backtrace.h"
 #include "debug_log.h"
 #include "MapData.h"
@@ -163,13 +165,9 @@
 
     char buf[1024];
     if (symbol != nullptr) {
-      char* demangled_symbol = __cxa_demangle(symbol, nullptr, nullptr, nullptr);
-      const char* best_name = (demangled_symbol != nullptr) ? demangled_symbol : symbol;
-
       async_safe_format_buffer(
           buf, sizeof(buf), "          #%02zd  pc %" PAD_PTR "  %s%s (%s+%" PRIuPTR ")\n", frame_num,
-          rel_pc, soname, offset_buf, best_name, frames[frame_num] - offset);
-      free(demangled_symbol);
+          rel_pc, soname, offset_buf, demangle(symbol).c_str(), frames[frame_num] - offset);
     } else {
       async_safe_format_buffer(
           buf, sizeof(buf), "          #%02zd  pc %" PAD_PTR "  %s%s\n", frame_num, rel_pc, soname,