Avoid atomicModifyIORef' which relies on newer GHC's