Block TIMER_SIGNAL in sigprocmask(SIG_SETMASK, ...).

Previously, we were zeroing out the reserved signals, when we actually
wanted to have TIMER_SIGNAL always be blocked, and the other signals
always be unblocked. This resulted in process termination when a
SIGEV_THREAD timer callback calls sigprocmask(SIG_SETMASK, ...) with
any signal mask value, and then subsequently fails to complete its
callback and reach the sigtimedwait in bionic before the next timer
iteration triggers.

Add a how argument to filter_reserved_signals to appropriately
block/unblock our reserved signals.

Bug: http://b/116783733
Test: bionic-unit-tests32/64
Change-Id: Ie5339682cdeb914711cd4089cd26ee395704d0df
diff --git a/libc/bionic/signal.cpp b/libc/bionic/signal.cpp
index 175182b..d6be09a 100644
--- a/libc/bionic/signal.cpp
+++ b/libc/bionic/signal.cpp
@@ -263,7 +263,7 @@
   sigset64_t mutable_set;
   sigset64_t* mutable_set_ptr = nullptr;
   if (set) {
-    mutable_set = filter_reserved_signals(*set);
+    mutable_set = filter_reserved_signals(*set, SIG_SETMASK);
     mutable_set_ptr = &mutable_set;
   }
   return __rt_sigsuspend(mutable_set_ptr, sizeof(*set));
@@ -279,7 +279,7 @@
   sigset64_t mutable_set;
   sigset64_t* mutable_set_ptr = nullptr;
   if (set) {
-    mutable_set = filter_reserved_signals(*set);
+    mutable_set = filter_reserved_signals(*set, SIG_SETMASK);
     mutable_set_ptr = &mutable_set;
   }
   return __rt_sigtimedwait(mutable_set_ptr, info, timeout, sizeof(*set));