codeGen: Fix memory barriers of array operations
Here we fix #23541 (closed) by giving the memory loads of array indexing operations the necessary acquire ordering semantics.
Also, refactor the writeArray#
paths to use a release store instead of a release fence, ensuring that TSAN is able to reason about the ordering implications of these operations.