Add duplicate attachment file renamer/replacer

Uses the existing AttachmentData#replaced_by mechanism to ensure we
can still continue to serve requests for the old filenames.
Add duplicate attachment filename finder

We can use this to generate a report detailing the attachments that
currently have duplicate filenames and also in the data migration that
will fix the duplicates
Fix Attachment.files scope to deal with STI fail

STI does not work very well with nested attributes because the type
column is protected by ActiveRecord (in 3.2 at least). And because
attachments (at least currently) on policy advisory groups and
corporate information pages are managed using nested attributes, we
can't prevent base Attachments from existing in the database. Once we
have got rid of the nested attributes, we can make the base Attachment
class abstract and prevent instances being created in future.
Migration to fix duplicate files on editions

Any published editions with attachments that have duplicate filenames
are re-editioned and updated to make their attachment files unique
before being published as a minor change. This uses a modified
EditionForcePublisher that skip validations and resets the force
published flag. This is because there are a number of old editions
which do not have any topics set. It also means we do not need to
worry about waiting for the virus scanner to finish scanning before
publishing.