lines/2: support streams w/o set_stream_position/2

This new implementation of lines/2 is about twice as fast and supports
streams for which set_stream_position/2 can't be used (think network
streams).   Most of this code could be reused since
read_line_to_string/2 is about the only piece that's specific to
lines/2.  It will eventually find a home in iterate/3 or something.

Closes #3