Avoid referencing out of bounds elements
Avoid referencing out of bounds elements

Current way of obtaining bounds for `std::partial_sort` leads
to out of bounds assertion error in `std::vector`. This patch
replaces `access by index + dereferencing` with getting pointer
for 0th element and then advancing it forward.
The latter approach is equivalent but safe.

tjrileywisc/annoy,eddelbuettel/annoy,pombredanne/annoy,spotify/annoy,eddelbuettel/annoy,tjrileywisc/annoy,eddelbuettel/annoy,tjrileywisc/annoy,pombredanne/annoy,eddelbuettel/annoy,spotify/annoy,spotify/annoy,spotify/annoy,pombredanne/annoy,pombredanne/annoy,tjrileywisc/annoy