memory: use atomic ops for setting dirty memory bits