Fix broken return code of M_INITIALIZE_GWP_ASAN.

When calling android_mallopt using M_INITIALIZE_GWP_ASAN, nothing
was being returned. Fix this, add a test, and also refactor the
code a bit so dynamic and static share the same code.

Test: Unit tests pass in dynamic and static versions.
Test: Passed using both jemalloc and scudo.
Change-Id: Ibe54b6ccabdbd44d2378892e793df393978bc02b
diff --git a/libc/bionic/gwp_asan_wrappers.cpp b/libc/bionic/gwp_asan_wrappers.cpp
index 6eb1749..8c51347 100644
--- a/libc/bionic/gwp_asan_wrappers.cpp
+++ b/libc/bionic/gwp_asan_wrappers.cpp
@@ -277,3 +277,14 @@
 bool DispatchIsGwpAsan(const MallocDispatch* dispatch) {
   return dispatch == &gwp_asan_dispatch;
 }
+
+bool EnableGwpAsan(bool force_init) {
+  if (GwpAsanInitialized) {
+    return true;
+  }
+
+  bool ret_value;
+  __libc_globals.mutate(
+      [&](libc_globals* globals) { ret_value = MaybeInitGwpAsan(globals, force_init); });
+  return ret_value;
+}