Delete files in a safe way