Cache header file reads between CMake invocations.

The file will be re-read if CPP_IDENTIFIERS or the file itself
changes. This ensures that we don't spend a long time reading files
in the configure stage in this module.