Cache length in ElementData::getAttributeItemIndex() for performance

Cache length in ElementData::getAttributeItemIndex() for performance.
We should avoid to call ElementData::length() in a loop as it hides an
if check to see if the ElementData is unique or not.

I see a 2.8% improvement on Bindings/id-setter.html performance test on
Linux desktop. This minimizes the performance regression caused by
r157508.

R=arv, esprehn
BUG=293663

Review URL: https://codereview.chromium.org/105163003

git-svn-id: svn://svn.chromium.org/blink/trunk@163216 bbb929c8-8fbe-4397-9dbb-9b2b20218538