Fix to deal with possible problem in end of line list

I found a problem with packets getting outside the line list in pure H test model. Tracked to issues in the binary_search.

Fixes proposed here (and noted in change log). I will open a issue - we should also introduce some tests on the binary search / handling of last line position. But in the meantime we should considering merging my fixes, if everyone agrees that the previous was wrong and that this is correct.

@wkerzendorf @mklauser Please look and merge if you agree.