[libc++] Improve libc++ tests when using optimizations (#88897)

Some tests were missing DoNotOptimize annotations.
14 jobs for main
in 0 seconds and was queued for 0 seconds