Return the correct count from getAttachedShaders

The count should be the total amount of shader ids written. Before
this patch the code used to write the amount of attached shaders
to count regardless of the value of maxCount.

BUG=angleproject:1101
TEST=dEQP-GLES3.functional.state_query.shader.*

Change-Id: I5ae729748c7809f03fd496c927a76f60398d2b42
Reviewed-on: https://chromium-review.googlesource.com/329865
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index 748ceae..bd16fd9 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -859,9 +859,8 @@
         if (total < maxCount)
         {
             shaders[total] = mData.mAttachedVertexShader->getHandle();
+            total++;
         }
-
-        total++;
     }
 
     if (mData.mAttachedFragmentShader)
@@ -869,9 +868,8 @@
         if (total < maxCount)
         {
             shaders[total] = mData.mAttachedFragmentShader->getHandle();
+            total++;
         }
-
-        total++;
     }
 
     if (count)