Adapt upstream fix from a314.
This fixes some odd behaviour in Workbench such as:
- Icons that were "Left Out" would reappear in their parent windows
when refreshed.
- Deleted files would not disappear from the window unless it was
refreshed.
Original message from a314 commit:
This call is used in at least 2.1 to terminate directory traversal
when deleting a directory using Workbench. This sometimes caused
unhandled exceptions in a314d and much worse unintended files being
deleted!