readline: fix performance issue when large line

Only run lineEnding.test() on the newly acquired chunk of string instead
of on the entire line buffer.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>