[10116] stdio.File.byLine repeats last line forever, readln(ref C[],R) returns bad data

byLine expects readln to return with an empty buffer on end-of-stream,
which readln does not do for wchar and dchar. Also, the readln variant
that takes a terminator range returns incorrect concatenations of
lines because of the same issue. Fixed by setting buffer.length=0 in
readln for this case. Unit test updated to detect this issue.
Merge pull request #1295 from M-frankied/byLine-infloop

[10116] stdio.File.byLine repeats last line forever, readln(ref C[],R) r...