Use atomicModifyIORef'

atomicModifyIORef' can simplify code as it gives all required
guarantees.
Drop unnessesary compatibility.

Current implementation implies ghc >= 7.8 and base >= 4.7
this means that we can drop code that introduced compatibility
with no longer supported library versions.