index: don't include nullid in boundary check in pure code
Yet another change that should probably have been part of a3dacabd476b
(index: don't allow index[len(index)] to mean nullid, 2018-07-20).
Differential Revision: https://phab.mercurial-scm.org/D4333