[GHC] #8345: A more efficient atomicModifyIORef'