Adds hasOwnProperty check in getMaxIndexLength (util.js)

This adds the hasOwnProperty check in getMaxIndexLength. Without this,
there may be an odd offset when there is something in the prototype.