Fix extension detection on core contexts.

This fixes a longstanding issue where GLEW is completely broken on core contexts because glGetString(GL_EXTENSIONS) is no longer valid. When this happens build the string manually.

Tested on 64-bit Linux.

Quick test program for SDL2: http://pastebin.com/KP13Haby