Better handling of optional OpenGL functionality

texture_rg: textures with just one or two channels
vertex_array_object: required for OpenGL >= 3.0
Create OpenGL 3.2 Core context on Linux

This is mainly to ensure that Halide works correctly with modern OpenGL, in
particular in applications that don't provide compatibility contexts.