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.

Bug: 27208635
(cherry picked from commit 2c75991359df165ca7cc7a6213fb227c0b5ed87c)

Change-Id: Ia93aaf010fbce1ace058439427066ea2dfd8bd13
diff --git a/libc/malloc_debug/backtrace.h b/libc/malloc_debug/backtrace.h
index 9e01009..f570873 100644
--- a/libc/malloc_debug/backtrace.h
+++ b/libc/malloc_debug/backtrace.h
@@ -32,9 +32,12 @@
 #include <stdint.h>
 #include <sys/cdefs.h>
 
+#include <string>
+
 void backtrace_startup();
 void backtrace_shutdown();
 size_t backtrace_get(uintptr_t* frames, size_t frame_count);
 void backtrace_log(const uintptr_t* frames, size_t frame_count);
+std::string backtrace_string(const uintptr_t* frames, size_t frame_count);
 
 #endif // MALLOC_DEBUG_BACKTRACE_H