Memoize directory-dirs-with-headers to prevent hanging when opening objc files.