vga: fix region checks in wraparound case