Reland of "Store the applied element array buffer as a binding pointer."

To be consistent with how we start vertex attributes. A null pointer
indicates we're using the streaming buffer.

Will also aid the dirty state bits refactor.

The re-land fixes a crash with WebGL related to element array buffers.

BUG=angleproject:1040
TEST=WebGL CTS, end2end_tests, unittests

Change-Id: I9b82e06825bf95f0fc2b7c7427e1eb6dd257c1ee
Reviewed-on: https://chromium-review.googlesource.com/290044
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 23d7f88..6c70a25 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -1422,9 +1422,9 @@
     mState.removeArrayBufferBinding(buffer);
 
     // mark as freed among the vertex array objects
-    for (auto vaoIt = mVertexArrayMap.begin(); vaoIt != mVertexArrayMap.end(); vaoIt++)
+    for (auto &vaoPair : mVertexArrayMap)
     {
-        vaoIt->second->detachBuffer(buffer);
+        vaoPair.second->detachBuffer(buffer);
     }
 }