EDGE-4439: Giving writable permissions before deleting file