opengl: Add many more CHECK_GL_ERROR()'s before returning from functions.

Change-Id: I63c147acf9a4013008b0f6d76867186f04ee57d5