mesa: make error handling in glGetTexParameter() a bit more concise