passthrough: fix segmentation fault after hotplug pass-through device
This patch fixed the QEMU segmentation fault after hotplug
pass-through devices with MSI-X for many times.
There is a wrong boundary check in cpu_register_io_memory that uses
io_index rather than io_mem_nb. After many times of hotplug of MSI-X
pass-through device, io_mem_read[] got extended to overwrite mmio_cnt,
then cause QEMU segmentation fault.
This fix sync with upstream QEMU code in exec.c, and free unused
io_mem_XXX element after hot removal.