Terminate search as soon as output limit is reached

Previously we processed a chunk fully until we hit the output limit.
Moreover, multiple chunks could be read and queued for decompression, even if
the limit was reached very quickly.

This was especially problematic on worst-case matches where searching takes a lot of time -
for example for "." queries with highlighting we need to scan an entire line for ".".

Terminating earlier reduces search time with highlighting for "." with L100 from 9500 ms to 130 ms.
Terminate local chunk processing if chunk already has enough results

Since chunk processing is parallel but output is strictly ordered, we don't
necessarily know from the global state that we already reached the line limit.

This can lead to increased processing for both current chunk and chunks from parallel
threads.

Since chunk already has a line counter, we're now checking it at critical points to terminate
chunk processing if it exhausted the line limit on its own. This is a conservative check - not
all output from the chunk will be printed, but we definitely don't need to process more than the
limit.