Added relaxed atomics and used them in the global heap

This is for #6598
I haven't tested it for performance changes though.