Make the ERAttachmentAsyncQueue more fault tolerant

This pull request includes two commits that may be accepted separately. They are intended to make the `ERAttachmentUploadQueue` more fault tolerant.

The first commit is a refactoring of the `ERS3UploadQueue` and `ERCloudFilesUploadQueue` classes to share the same implementation. It also avoid accidental death of the queue thread by executing the upload preparation inside of a try-catch block.

The second commit improves the way attachments and editing contexts are handled by the attachment queue executor. The new solution creates a new editing context to process each attachment reducing considerably the chance of inconsistencies.

The commit messages contain a detailed description of the changes.