fix unlink while localscan is running