KVM: fix the handling of dirty bitmaps to avoid overflows