[CM3] Add core interrupt masking for easy creation of atomic blocks