Add semaphore tests, fix sem_destroy.

Bug: https://code.google.com/p/android/issues/detail?id=76088
Change-Id: I4a0561b23e90312384d40a1c804ca64ee98f4066
diff --git a/libc/bionic/pthread_rwlock.cpp b/libc/bionic/pthread_rwlock.cpp
index 063137b..0d63457 100644
--- a/libc/bionic/pthread_rwlock.cpp
+++ b/libc/bionic/pthread_rwlock.cpp
@@ -30,6 +30,7 @@
 
 #include "pthread_internal.h"
 #include "private/bionic_futex.h"
+#include "private/bionic_time_conversions.h"
 
 /* Technical note:
  *
@@ -71,7 +72,7 @@
 
 static bool timespec_from_absolute(timespec* rel_timeout, const timespec* abs_timeout) {
   if (abs_timeout != NULL) {
-    if (__timespec_from_absolute(rel_timeout, abs_timeout, CLOCK_REALTIME) < 0) {
+    if (!timespec_from_absolute_timespec(*rel_timeout, *abs_timeout, CLOCK_REALTIME)) {
       return false;
     }
   }