Throws an exception if deleting a file fails.