Use GLint from client state parameters in glGetBooleanv

Bug: 186021150

Some values (like gl stencil ones) might end with zero bits making the cast to boolean count as
zero.

Test: dEQP-GLES3.functional.state_query* regressions fixed
Change-Id: Iaab1dc8af0f3965fa39421de14b906d62bb5fcc7
diff --git a/system/GLESv2_enc/GL2Encoder.cpp b/system/GLESv2_enc/GL2Encoder.cpp
index 931fa4e..add8425 100755
--- a/system/GLESv2_enc/GL2Encoder.cpp
+++ b/system/GLESv2_enc/GL2Encoder.cpp
@@ -1104,10 +1104,14 @@
 
     default:
         if (!state) return;
-        if (!state->getClientStateParameter<GLboolean>(param, ptr)) {
-            ctx->safe_glGetBooleanv(param, ptr);
+        {
+            GLint intVal;
+            if (!state->getClientStateParameter<GLint>(param, &intVal)) {
+                ctx->safe_glGetBooleanv(param, ptr);
+            } else {
+                *ptr = (intVal != 0) ? GL_TRUE : GL_FALSE;
+            }
         }
-        *ptr = (*ptr != 0) ? GL_TRUE : GL_FALSE;
         break;
     }
 }