Ensure that temporary file is always deleted