BlockLevelPass: further fixes for T218817
The previous fix for T218817 (I22eebb70af1b19d7c25241fc78bfcced4470e78a)
was a bit premature: we didn't notice that ExplodeIterator *also*
used a different Iterator::key() than ArrayIterator -- it used
the string position as a key, not the line number. Combined with
an inequality test for "not the last line" meant that almost every
line was now the "last line" and we were missing a lot of needed
newlines.
Count the lines ourselves to fix the problem.
Bug: T208070
Bug: T218817
Change-Id: I55a2c4c0ec304292162c51aa88b206fea0142392