Improve ignore dirs/files routine in server scanner.