Revert^2 "Use DoNotOptimize rather than rely on a volatile."

The previous code used a volatile to avoid optimizing away
the strlen, but it can trigger the unused variable warning.
Instead use DoNotOptimize to avoid the code being optimized away.

Break out the DoNotOptimize into it's own header since the entirety
of utils.h cannot be included here without getting compile errors.
Add the new include to all tests that use DoNotOptimize.

Test: Tests build and pass.
Change-Id: I1965ff7f36f1bcb8b410022c57c9ddd466a3b99f
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index 813f348..3f1ba79 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -47,6 +47,7 @@
 #include <android-base/file.h>
 #include <android-base/test_utils.h>
 
+#include "DoNotOptimize.h"
 #include "utils.h"
 
 #if defined(__BIONIC__)