Add backtrace_string and export to libmemunreachable

Add backtrace_string to convert a malloc_debug backtrace to a string.
Also move the backtrace functions to libc_malloc_debug_backtrace so that
libmemunreachable can reuse them.

Change-Id: I5ad67001c0b4d184903c762863a8588181d4873b
diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp
index e079c7e..aa6f5f7 100644
--- a/libc/malloc_debug/malloc_debug.cpp
+++ b/libc/malloc_debug/malloc_debug.cpp
@@ -223,10 +223,10 @@
     g_debug->track->DisplayLeaks(*g_debug);
   }
 
-  backtrace_shutdown();
-
   DebugDisableSet(true);
 
+  backtrace_shutdown();
+
   delete g_debug;
   g_debug = nullptr;