Fix a crash when there is an empty directory and a plugin is unloaded