When generating the config.h configuration file, write to a temporary
first and then rename afterward to avoid touching the file and thus
triggering a complete rebuild (of everything that includes config.h)
unnecessarily.
We need the list of variables to put in config.h for the CMake config-
mode module; reuse the code that writes the list to config.h in the
first place to also write CMake-compatible lines.
Modules that starts with the prefix "Use" alters the build to enable
something by default, whereas modules that only provide functionality
is not common to start with that prefix.