finally found the VNC bug I was hunting so long

It happens (against the strict interpretation of the RFB protocol) that qemu
sends 2 frame buffer update messages as answer to an update request. The buffered
read of perl's IO::Socket will read in both fully, so the select() we return
into after parsing the first message is not returning vnc socket. So we miss the
2nd message forever

So set the socket to non blocking, read a byte and if a byte can be read,
read the rest. And do this independent of select