Upgrade to current NetBSD popen/pclose.

This gets us back to using vfork now our ARM vfork assembler stub is
fixed, and adds the missing thread safety for the 'pidlist'.

Bug: 5335385
Change-Id: Ib08bfa65b2cb9fa695717aae629ea14816bf988d
diff --git a/libc/upstream-netbsd/reentrant.h b/libc/upstream-netbsd/reentrant.h
index a4381d4..e2945da 100644
--- a/libc/upstream-netbsd/reentrant.h
+++ b/libc/upstream-netbsd/reentrant.h
@@ -17,9 +17,22 @@
 #ifndef _BIONIC_NETBSD_REENTRANT_H_included
 #define _BIONIC_NETBSD_REENTRANT_H_included
 
+#define _REENTRANT
+
 #include <pthread.h>
 #include <signal.h>
 
-// Placeholder.
+//
+// Map NetBSD libc internal locking to pthread locking.
+//
+
+#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#define mutex_t pthread_mutex_t
+
+#define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER
+#define rwlock_t pthread_rwlock_t
+#define rwlock_rdlock pthread_rwlock_rdlock
+#define rwlock_unlock pthread_rwlock_unlock
+#define rwlock_wrlock pthread_rwlock_wrlock
 
 #endif