Fix #15862 remove dirs in keep list when walk path

Way do you create a copy of the list if you're assigning a new value to it? ... Just curious...