Override XShmQueryExtension in preload.c to disable XShm
Merge #769.