Fix #15862 remove dirs in keep list when walk path

Would you consider that:

```python
for roots, dirs, files in os.walk(root):
        for name in [d for d in dirs if os.path.join(root, d) not in keep]:
            nfn = os.path.join(roots, name)
            if os.path.islink(nfn):
                # the "directory" is in fact a symlink and cannot be
                # removed by shutil.rmtree
                files.append(nfn)
                continue
            if nfn not in real_keep:
                # -- check if this is a part of exclude_pat(only). No need to
                # check include_pat
                if not salt.utils.check_include_exclude(
                        nfn[len(root) + 1:], None, exclude_pat):
                    continue
                removed.add(nfn)
                if not __opts__['test']:
                    shutil.rmtree(nfn)
        for name in files:
            nfn = os.path.join(roots, name)
            if nfn not in real_keep:
                # -- check if this is a part of exclude_pat(only). No need to
                # check include_pat
                if not salt.utils.check_include_exclude(
                        nfn[len(root) + 1:], None, exclude_pat):
                    continue
                removed.add(nfn)
                if not __opts__['test']:
                    os.remove(nfn)
    return list(removed)
```
Has the same end result as:
```
for roots, dirs, files in os.walk(root):
        dirs[:] = [d for d in dirs if os.path.join(root, d) not in keep]
        for name in dirs:
            nfn = os.path.join(roots, name)
            if os.path.islink(nfn):
                # the "directory" is in fact a symlink and cannot be
                # removed by shutil.rmtree
                files.append(nfn)
                continue
            if nfn not in real_keep:
                # -- check if this is a part of exclude_pat(only). No need to
                # check include_pat
                if not salt.utils.check_include_exclude(
                        nfn[len(root) + 1:], None, exclude_pat):
                    continue
                removed.add(nfn)
                if not __opts__['test']:
                    shutil.rmtree(nfn)
        for name in files:
            nfn = os.path.join(roots, name)
            if nfn not in real_keep:
                # -- check if this is a part of exclude_pat(only). No need to
                # check include_pat
                if not salt.utils.check_include_exclude(
                        nfn[len(root) + 1:], None, exclude_pat):
                    continue
                removed.add(nfn)
                if not __opts__['test']:
                    os.remove(nfn)
    return list(removed)
```
this last one is a copy of your code.