Write out to CSV as we go along.

As a side benefit we're not keeping two maps of the broken links in memory, just one for caching.