COMP: Guard against infinite loop in vtkClearOpenGLErrors

Some platforms/drivers do not properly clear the error flags after a
call to glGetError(). This can lead to an infinite loop. This patch
limits the number of calls to glGetError() to a user provided value or
a default (16).

Thanks to Richard Whitehead and Marco Sambin for reporting the
problem.

Change-Id: Ie63bec0b47cc6c8047cedf615c4c65f9bcdd30aa