Fix performance regression in qemu_get_ram_ptr