Fix sigaction(3) for 64-bit.

Also clean up <signal.h> and revert the hacks that were necessary
for 64-bit in linker/debugger.cpp until now.

Change-Id: I3b0554ca8a49ee1c97cda086ce2c1954ebc11892
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index 4a7c155..a03232f 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -284,11 +284,13 @@
 
 TEST(pthread, pthread_kill__in_signal_handler) {
   struct sigaction action;
+  struct sigaction original_action;
   sigemptyset(&action.sa_mask);
   action.sa_flags = 0;
   action.sa_handler = pthread_kill__in_signal_handler_helper;
-  sigaction(SIGALRM, &action, NULL);
+  ASSERT_EQ(0, sigaction(SIGALRM, &action, &original_action));
   ASSERT_EQ(0, pthread_kill(pthread_self(), SIGALRM));
+  ASSERT_EQ(0, sigaction(SIGALRM, &original_action, NULL));
 }
 
 TEST(pthread, pthread_detach__no_such_thread) {