small fixes and optimizations in varfilter.py
Fixed error of os.rename: "Invalid cross-device link"