prevent duplicate file uploads per entity-role

Because files are named {repo}-{org}-{cid}-{eid}-{role}-{sha1},
it was possible for users to upload the same file to a given
entity-role combination more than once. When this happened the
file was not changed (it had the same SHA1) but metadata was lost
and users could accidently delete the file entirely when trying
to fix the problem.

This change prevents uploading duplicate files.

- The SHA1 generation step is moved to the beginning.
- SHA1 is passed in to dest_filename generator function to avoid
  generating it twice.
- An exception is thrown if there's a duplicate.
- Celery failure messaging was updated to display Exceptions.