Fix possibility of non-removed symlinked directory.

Fixes #4080
:+1: Good catch!