Guard __libc_current_sigrtmin/max with __builtin_available

The two APIs were added for the API level 21 and beyond. Currently, its
existence is tested using the null check which is done regardless of the
min sdk version of the compilation unit. (which in turn required us to
mark the API symbol weak regardless of the min sdk version.)

Now, we have a better way of testing the API availability;
__builtin_available. The null check is replaced with the call to the
compiler-provided macro which determines if the code is running in a
version of OS where the API is known to exist.

Bug: 150860940
Bug: 134795810
Test: m
Change-Id: Ib96c78f8d3cc71d7e755d1eab86051517bbbcc44
diff --git a/libc/include/android/legacy_signal_inlines.h b/libc/include/android/legacy_signal_inlines.h
index 90eda7d..a673446 100644
--- a/libc/include/android/legacy_signal_inlines.h
+++ b/libc/include/android/legacy_signal_inlines.h
@@ -45,12 +45,16 @@
 int __libc_current_sigrtmin() __attribute__((__weak__)) __VERSIONER_NO_GUARD;
 
 static __inline int __ndk_legacy___libc_current_sigrtmax() {
-  if (__libc_current_sigrtmax) return __libc_current_sigrtmax();
+  if (__builtin_available(android 21, *)) {
+    return __libc_current_sigrtmax();
+  }
   return __SIGRTMAX; /* Should match __libc_current_sigrtmax. */
 }
 
 static __inline int __ndk_legacy___libc_current_sigrtmin() {
-  if (__libc_current_sigrtmin) return __libc_current_sigrtmin();
+  if (__builtin_available(android 21, *)) {
+    return __libc_current_sigrtmin();
+  }
   return __SIGRTMIN + 7; /* Should match __libc_current_sigrtmin. */
 }