prevent attachment duplicate renaming race conditions

fixes #CNVS-1496

Change-Id: I8de82e2633aacc17a78f2f7c008b1e96a2609269
Reviewed-on: https://gerrit.instructure.com/41521
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>