adb: make adb_thread_func_t return void, add adb_thread_exit.

Windows restricts the return value of threads to 32-bits, even on 64-bit
platforms. Since we don't actually return meaningful values from thread,
resolve this inconsistency with POSIX by making adb's thread abstraction
only take void functions.

Change-Id: I5c23b4432314f13bf16d606fd5e6b6b7b6ef98b5
diff --git a/adb/sysdeps_test.cpp b/adb/sysdeps_test.cpp
index 24a0d6f..e6037d7 100644
--- a/adb/sysdeps_test.cpp
+++ b/adb/sysdeps_test.cpp
@@ -20,10 +20,9 @@
 
 #include "sysdeps.h"
 
-static void* increment_atomic_int(void* c) {
+static void increment_atomic_int(void* c) {
     sleep(1);
     reinterpret_cast<std::atomic<int>*>(c)->fetch_add(1);
-    return nullptr;
 }
 
 TEST(sysdeps_thread, smoke) {
@@ -57,3 +56,14 @@
 
     ASSERT_EQ(500, counter.load());
 }
+
+TEST(sysdeps_thread, exit) {
+    adb_thread_t thread;
+    ASSERT_TRUE(adb_thread_create(
+        [](void*) {
+            adb_thread_exit();
+            for (;;) continue;
+        },
+        nullptr, &thread));
+    ASSERT_TRUE(adb_thread_join(thread));
+}