Rewrite all reductions to race-free in MLIR mode.
Rewrite all reductions to race-free in MLIR mode.

The difference in runtimes in the original benchmarks that
motivated this change seem rather large. We can surely
do better than that. Atomics contribute a lot of complexity,
so if possible, we should try to avoid them.
