defend iterator against symlink attack
throw error if iterator opendir fails