Previously, gitleaks.writeReport used json.MarshallIndent on the entire
set of leaks when writing json reports, which would cause failures due
to excessive memory consumption when a large number of leaks were
identified.
This PR addresses the problem by doing incremental marshalling and
writing of leaks to the report file, and reduces the memory footprint by
several GB in tests with >30k leaks.
* only check entropyRegexes and whiteListRegexes once per line, and only
if regex or entropy leak type was found, since regex checks are expensive
* check whiteListFiles once for each FilePatch, instead of for
every Chunk