Clean up untag_address.

We had two copies of this function, one (not quite correct) in tests/utils.h
and another in bionic/macros.h. Delete the former and have the users include
the latter.

Also, create an overload of the function that takes a uintptr_t, which will
be useful for out-of-process scenarios such as the MTE support in debuggerd.

Bug: 135772972
Change-Id: Ia3c2652c97797663146b3f05fa786afe09f7ea97
diff --git a/libc/platform/bionic/macros.h b/libc/platform/bionic/macros.h
index 28a69e6..076cff1 100644
--- a/libc/platform/bionic/macros.h
+++ b/libc/platform/bionic/macros.h
@@ -83,11 +83,15 @@
 #define __BIONIC_FALLTHROUGH
 #endif
 
-template <typename T>
-static inline T* untag_address(T* p) {
+static inline uintptr_t untag_address(uintptr_t p) {
 #if defined(__aarch64__)
-  return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & ((1ULL << 56) - 1));
+  return p & ((1ULL << 56) - 1);
 #else
   return p;
 #endif
 }
+
+template <typename T>
+static inline T* untag_address(T* p) {
+  return reinterpret_cast<T*>(untag_address(reinterpret_cast<uintptr_t>(p)));
+}