glstate: Use helper function for flushing GL errors.