xcbgrab: Decide the pixel format from the pixmap_format

Use the same method used by VLC.