Add semaphore tests, fix sem_destroy.

Bug: https://code.google.com/p/android/issues/detail?id=76088
Change-Id: I4a0561b23e90312384d40a1c804ca64ee98f4066
diff --git a/libc/include/limits.h b/libc/include/limits.h
index fb09657..f9f0c79 100644
--- a/libc/include/limits.h
+++ b/libc/include/limits.h
@@ -49,6 +49,7 @@
 #define	_POSIX_PATH_MAX		256
 #define _POSIX_PIPE_BUF		512
 #define	_POSIX_RE_DUP_MAX	255
+#define	_POSIX_SEM_VALUE_MAX	32767
 #define _POSIX_SSIZE_MAX	32767
 #define _POSIX_STREAM_MAX	8
 #define _POSIX_SYMLINK_MAX	255
@@ -125,4 +126,7 @@
 /* glibc's PAGE_MASK is the bitwise negation of BSD's! TODO: remove? */
 #define PAGE_MASK (~(PAGE_SIZE - 1))
 
+#define _POSIX_SEMAPHORES 200809L
+#define SEM_VALUE_MAX 0x3fffffff
+
 #endif /* !_LIMITS_H_ */