glxinfo: move reusable, non-GLX code into glinfo_common.[ch]

So that we can share some of the code with wglinfo.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
wglinfo: use common code from glinfo_common.c

Reviewed-by: José Fonseca <jfonseca@vmware.com>
wglinfo: Don't rely on GL/glext.h

GL/glext.h is not commonly available when building on Windows (though
recent MinGW versions seem to have it.)  So get the defines from
GL/glew.h to avoid introducing a new build

Trivial.  Verified glxinfo and wglinfo build correctly.
wglinfo: Use _snprintf on Windows.

Prevents missing snprintf with MSVC.