Improved GL version string handling

Some drivers return the OpenGL version string with a patch number (e.g.
"3.0.0") which caused the existing version detection to fail (it only
matches major-minor strings such as "3.0").  This commit detects the
second "." in such strings and truncates to it.