Throws an exception if deleting a file fails.
Also throws an exception if rename fails.
Merge pull request #15 from bgrozev/failsafetransaction-fix

Throws an exception if deleting or renaming a file fails.