Enable functional DSO object destruction

Unfortunately, legacy .so files for ARM don't have a correct crtbegin file.
Consequently, we have to grandfather the old __dso_handle behaviour.
Add some ifdefs for ARM to allow it to use the old code until we can work
out a transition.

Change-Id: I6a28f368267d792c94e1d985d8344023bc632f6f
Author: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index 4ba2177..f4bcab9 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -104,6 +104,7 @@
 	return (ret);
 }
 
+#ifdef CRT_LEGACY_WORKAROUND
 /*
  * Register a function to be performed at exit.
  */
@@ -112,6 +113,7 @@
 {
 	return (__cxa_atexit((void (*)(void *))func, NULL, NULL));
 }
+#endif
 
 /*
  * Call all handlers registered with __cxa_atexit() for the shared