Prevent deadlocks on unreadable directories.