Move some pthread functions to signal.h.

POSIX specifies that pthread_kill(3) and pthread_sigmask(3) are
supposed to live in signal.h rather than pthread.h.

Since signal.h now needs pthread_t and pthread_attr_t, I've moved
those defintions into include/machine/pthread_types.h to keep the
namespace clean. I also sorted some includes. The combination of these
two things seems to have exploded into a cascade of missing includes,
so this patch also cleans up all those.

Change-Id: Icfa92a39432fe83f542a797e5a113289d7e4ad0c
diff --git a/libc/include/signal.h b/libc/include/signal.h
index e23e65b..6d89ef7 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -29,12 +29,13 @@
 #ifndef _SIGNAL_H_
 #define _SIGNAL_H_
 
-#include <errno.h>
-#include <sys/cdefs.h>
-#include <limits.h>		/* For LONG_BIT */
-#include <string.h>		/* For memset() */
-#include <sys/types.h>
 #include <asm/sigcontext.h>
+#include <errno.h>
+#include <limits.h>
+#include <machine/pthread_types.h>
+#include <string.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
 
 #if defined(__LP64__) || defined(__mips__)
 /* For 64-bit (and mips), the kernel's struct sigaction doesn't match the POSIX one,
@@ -129,6 +130,9 @@
 extern void psiginfo(const siginfo_t*, const char*);
 extern void psignal(int, const char*);
 
+extern int pthread_kill(pthread_t, int);
+extern int pthread_sigmask(int, const sigset_t*, sigset_t*);
+
 __END_DECLS
 
 #endif /* _SIGNAL_H_ */