Previously, a custom detector configured to use multiple patterns
would produce its results from a match in a nondeterministic order.
This behavior could be seen by running the custom detectors test in a
loop, e.g.,
$ cd pkg/custom_detectors
$ while true; do go test; done
This is likely to reveal sporadic test failures.
This nondeterminism was a result of producing results by iterating over
a map, which has unspecified order in Go.
The fix: sort the intermediate map data structure prior to producing
results.