xlib: Add support for automatic probing of XShm support

Standard code for testing whether the display connections offers the
MIT-SHM extension and then verifies that it works (in order to detect
and disable SHM over ssh X-tunneling).
xlib: Support ShmPixmap transport

A few drivers offer to create Pixmaps out of shared memory as it reduces
the overhead associated with ShmPutImage and allows the driver to
optimize storage of the pixmap within video memory. Here this means that
any redrawing we require is then a simple blit from within video memory,
rather than requiring a fresh transfer every time. This is only useful
if we redraw of course, but there should be negative consequences from
enabling the pixmap path where supported!