extra-cmake-modules: Use associative array to recognize paths
Fixes #99308.
Use an associative array to recognize paths that have already been seen by the
host path hook. This takes advantage of fast lookup of associative array keys in
Bash. The previous solution scanned a linear array, which was accidentally
quadratic.