Wrap 'real' task in transaction
Wrap 'real' task in transaction

There's a chance we could raise an exception if encountering an
unknown 'attachable_type', which would otherwise interfere with
the rest of the task, thereby making it easy to lose track of
the attachments we've fixed already.

There's also a chance we could hit an unexpected error at some
point.

It is good practice to wrap this in a transaction to auto roll
back if we encounter an issue. There's no need to do this on
the dry run as we don't make any database changes there.

alphagov/whitehall,alphagov/whitehall,alphagov/whitehall,alphagov/whitehall