Add result file creation.

Write the complete result of a duplicate check to a file. This allows
outside tools such as CI or an IDE to pick up the results of a
duplicate checker run and post-process or display it.
treat all patterns as case insensitive.