Immutable atomics

Closes #11583, rebasing of #12430 now that we've got `Share` and better analysis with statics.