Remove Cairo dependency on X11 and factorize X11 tests

Per discussion on the mailing list, it doesn't look like Cairo needs
X11 any more (it doesn't on OS X to generate PDFs and PNGs).  So
remove the dependency in configure.ac.

Also, move the X11 tests from outside of the Cairo tests (and outside
of the GL tests) to be in the main configure logic.

By the way, rename HWLOC_HAVE_X11 into HWLOC_HAVE_X11_KEYSYM to avoid
confusion between Xlib.h/XOpenDisplay being available (what GL needs)
and Xutil.h+keysym.h being available too (what lstopo/X11 needs).

Based on a patch from Jeff, tweaked by me.

(cherry picked from commit f33cbef975da707d0d3e1dbb208073980f1d1fd4)