Return EINVAL when calling pthread_detach for joined thread.

Change-Id: I717015132187e087e0ad485284a13c8801e25e77
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index de60f28..251a230 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -271,8 +271,11 @@
 
   sleep(1); // (Give t2 a chance to call pthread_join.)
 
-  // ...a call to pthread_detach on thread 1 will "succeed" (silently fail)...
+#if defined(__BIONIC__)
+  ASSERT_EQ(EINVAL, pthread_detach(t1));
+#else
   ASSERT_EQ(0, pthread_detach(t1));
+#endif
   AssertDetached(t1, false);
 
   spinhelper.UnSpin();