COMP: Guard against infinite loop in vtkClearOpenGLErrors
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

candy7393/VTK,keithroe/vtkoptix,SimVascular/VTK,berendkleinhaneveld/VTK,sankhesh/VTK,jmerkow/VTK,jmerkow/VTK,sumedhasingla/VTK,gram526/VTK,candy7393/VTK,candy7393/VTK,gram526/VTK,sankhesh/VTK,hendradarwin/VTK,ashray/VTK-EVM,mspark93/VTK,msmolens/VTK,hendradarwin/VTK,candy7393/VTK,jmerkow/VTK,berendkleinhaneveld/VTK,hendradarwin/VTK,sumedhasingla/VTK,keithroe/vtkoptix,hendradarwin/VTK,sumedhasingla/VTK,keithroe/vtkoptix,johnkit/vtk-dev,hendradarwin/VTK,ashray/VTK-EVM,demarle/VTK,sankhesh/VTK,jmerkow/VTK,sankhesh/VTK,mspark93/VTK,gram526/VTK,gram526/VTK,SimVascular/VTK,msmolens/VTK,SimVascular/VTK,sumedhasingla/VTK,gram526/VTK,mspark93/VTK,mspark93/VTK,jmerkow/VTK,demarle/VTK,berendkleinhaneveld/VTK,candy7393/VTK,sankhesh/VTK,berendkleinhaneveld/VTK,gram526/VTK,johnkit/vtk-dev,gram526/VTK,msmolens/VTK,ashray/VTK-EVM,sumedhasingla/VTK,candy7393/VTK,johnkit/vtk-dev,msmolens/VTK,sumedhasingla/VTK,mspark93/VTK,sumedhasingla/VTK,ashray/VTK-EVM,mspark93/VTK,msmolens/VTK,jmerkow/VTK,berendkleinhaneveld/VTK,sankhesh/VTK,sankhesh/VTK,mspark93/VTK,hendradarwin/VTK,keithroe/vtkoptix,johnkit/vtk-dev,hendradarwin/VTK,keithroe/vtkoptix,SimVascular/VTK,demarle/VTK,berendkleinhaneveld/VTK,demarle/VTK,ashray/VTK-EVM,msmolens/VTK,ashray/VTK-EVM,demarle/VTK,jmerkow/VTK,keithroe/vtkoptix,msmolens/VTK,johnkit/vtk-dev,ashray/VTK-EVM,jmerkow/VTK,berendkleinhaneveld/VTK,demarle/VTK,demarle/VTK,SimVascular/VTK,msmolens/VTK,SimVascular/VTK,sumedhasingla/VTK,keithroe/vtkoptix,ashray/VTK-EVM,candy7393/VTK,keithroe/vtkoptix,johnkit/vtk-dev,gram526/VTK,sankhesh/VTK,SimVascular/VTK,mspark93/VTK,SimVascular/VTK,candy7393/VTK,johnkit/vtk-dev,demarle/VTK