bionic: call stdio cleanup on exit

As of 61e699a133a4807fe878a6cb0d7190d7c96e21f8, stdio clean up
functions are no longer registered in atexit and must be called
manually via __cleanup.

The issue this fixes is some static binaries linked against bionic
cannot output properly when piped or redirected because the buffer
is not flushed before closing.

This is done by pulling in exit.c (and other dependencies) from
netbsd.

Change-Id: I193e54a6d08900f291550029fe75ce76394d9e22
diff --git a/libc/Android.mk b/libc/Android.mk
index b24320d..4ebd656 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -50,7 +50,6 @@
 	stdio/wbuf.c \
 	stdlib/atexit.c \
 	stdlib/ctype_.c \
-	stdlib/exit.c \
 	stdlib/getenv.c \
 	stdlib/putenv.c \
 	stdlib/setenv.c \
@@ -400,6 +399,7 @@
     upstream-netbsd/libc/stdlib/div.c \
     upstream-netbsd/libc/stdlib/drand48.c \
     upstream-netbsd/libc/stdlib/erand48.c \
+    upstream-netbsd/libc/stdlib/exit.c \
     upstream-netbsd/libc/stdlib/jrand48.c \
     upstream-netbsd/libc/stdlib/ldiv.c \
     upstream-netbsd/libc/stdlib/lldiv.c \
@@ -416,6 +416,7 @@
     upstream-netbsd/libc/string/strcasestr.c \
     upstream-netbsd/libc/string/strcoll.c \
     upstream-netbsd/libc/string/strxfrm.c \
+    upstream-netbsd/libc/thread-stub/__isthreaded.c \
     upstream-netbsd/libc/unistd/killpg.c \
 
 # Architecture specific source files go here