remove deleted files while scanning

fixes #4264 

cc @DeepDiver1975 @MTGap @karlitschek