Fix Issue 11810 - std.stdio.byLine/readln performance is very bad

Use read buffer for byLine to improve performance.

Adapted from patch in bugzilla originally by Juan Manuel Cabo (with
small changes from bearophile). See:
http://forum.dlang.org/post/iwzehyyyygldncyiblhg@forum.dlang.org
Validate UTF characters