Refactor malloc common into distinct pieces.

The pieces:
- The malloc common shared by static and dynamic code (malloc_common.cpp).
- The code for shared libraries that includes any dlopen'ing
  (malloc_common_dynamic.cpp).
- The implementation of perfetto's heapprofd (malloc_heapprofd.cpp).

This makes it easier to see what's going on in the many different areas.
It should also make it easier to add the allocation capping option.

Other related changes:
- Update the unit tests for android_mallopt. All of the current options
  don't work on static binaries, so make sure that is reflected in the test.
- A few names changes to make sure that all code is consistent.

Test: Ran tests (malloc hooks/malloc debug/perfetto/bionic unit tests).
Change-Id: I0893bfbc0f83d82506fac5d1f37cf92fbdef6f59
diff --git a/libc/symbol_ordering b/libc/symbol_ordering
index 8b2d153..c39fac5 100644
--- a/libc/symbol_ordering
+++ b/libc/symbol_ordering
@@ -6,8 +6,8 @@
 je_background_thread_enabled_state
 je_can_enable_background_thread
 _ZZ17__find_icu_symbolPKcE9found_icu
-_ZL28g_heapprofd_init_in_progress
-_ZL31g_heapprofd_init_hook_installed
+_ZL24gHeapprofdInitInProgress
+_ZL27gHeapprofdInitHookInstalled
 je_opt_abort
 je_opt_abort_conf
 je_opt_junk_alloc
@@ -174,7 +174,7 @@
 __res_randomid.__libc_mutex_random
 locallock
 g_atexit_lock
-_ZL11g_functions
+_ZL10gFunctions
 _ZL13vendor_passwd
 _ZL12vendor_group
 tm