Fix longstanding bug in GLEW when using Core profiles.

GLEW's OpenGL extension detection does not work with OpenGL core contexts.  This is because GLEW relies on glGetString(GL_EXTENSIONS) to get a list of extension strings.  This OpenGL API call was deprecated in the core profile, instead using an indexed glGetStringi(GL_EXTENSIONS, i) variant which GLEW does not use.

This fix is largely a hack to get the functionality that we need back into a largely working, useful library that is GLEW.  The fix certainly isn't elegant, but it gets the job done, should work fine on all platforms, and should maintain reentrancy when GLEW is compiled with GLEW_MX.

See the status of the (three year old!) GLEW bug here: http://sourceforge.net/p/glew/bugs/120/