Stop checking the global thread list in several trivial cases.

Since removing the global thread is hard, let's take the different
groups of functions individually.

The existing code was racy anyway, because the thread might still be
on the list but have exited (leaving tid == 0).

Bug: http://b/19636317
Test: ran tests
Change-Id: Icc0986ff124d5f9b8a653edf718c549d1563973b
diff --git a/libc/bionic/pthread_setschedparam.cpp b/libc/bionic/pthread_setschedparam.cpp
index 0ad68bb..a0520fb 100644
--- a/libc/bionic/pthread_setschedparam.cpp
+++ b/libc/bionic/pthread_setschedparam.cpp
@@ -34,14 +34,8 @@
 int pthread_setschedparam(pthread_t t, int policy, const sched_param* param) {
   ErrnoRestorer errno_restorer;
 
-  pthread_internal_t* thread = __pthread_internal_find(t);
-  if (thread == NULL) {
-    return ESRCH;
-  }
+  pid_t tid = reinterpret_cast<pthread_internal_t*>(t)->tid;
+  if (tid == 0) return ESRCH;
 
-  int rc = sched_setscheduler(thread->tid, policy, param);
-  if (rc == -1) {
-    return errno;
-  }
-  return 0;
+  return (sched_setscheduler(tid, policy, param) == -1) ? errno : 0;
 }