Avoid stale error state in caps evaluation and add assertion to ensure this
The multi-sample location query code must be entered with a clean error state. Fix the glGetIntegerv query that is invalid on GLES and add an assertion to catch such errors early if they are newly introduced.