Replace direct phys_ram_dirty access with wrapper functions.