Add memory barriers before enabling and after disabling ISRs.