Fix Issue 9599 - File.byLine doesn't function properly with take

Before, calling take could wrongly pop an extra line from the range.
Reading the current front is now only done when calling front().
Fix unreferencing ByLine.file once empty
Don't assume wrapped range has a const empty()
Make byLine return a reference-counted struct