fixed lots of not-thread-safe things

Most of the things I fixed here were using libc functions that are
fundamentally not thread-safe.
diff --git a/aos/common/logging/logging.h b/aos/common/logging/logging.h
index 49828bf..e6e14f9 100644
--- a/aos/common/logging/logging.h
+++ b/aos/common/logging/logging.h
@@ -11,7 +11,7 @@
 #include <errno.h>
 
 #include "aos/common/macros.h"
-#include "aos/common/util/aos_strerror.h"
+#include "aos/common/libc/aos_strerror.h"
 
 #ifdef __cplusplus
 extern "C" {