Only check for OpenGL errors in debug builds.

Might speed up rendering a bit.
Merge branch 'bugfixes'