Clean temp dir during initialization #1604

In case temporary directory already exists, clean it during preprocess
initialization.