Unlink files on write or error