When renaming attachment files, keep file extension if not provided
Properly revert attachment renames if they fail. Closes #430
Merge pull request #429 from aurimasv/rename-attachment

When renaming attachment files, keep file extension if not provided