Make dirty-bit tracking more reliable