cmDefinitions: Reduce allocation of keys and values in MakeClosure

Use `cm::String` to store keys and values so that `MakeClosure` does
not need to allocate new copies of all of them.

Issue: #19581
Status Job ID Name Coverage
  External
passed cdash

failed cmake-dash3win10-windows-release-ninja

failed cmake-hythloth-linux-debug-makefiles+sphinx

passed cmake-minoc-linux-release-lint-iwyu-tidy

failed cmake-moonshade-osx-debug-ninja

failed cmake-moonshade-osx-release-makefiles

failed cmake-terfin-windows-release-vs2019

passed ghostflow-check-master

failed cmake-dash3win10-windows-release-ninja

failed cmake-dash3win10-windows-release-ninja

00:01:26

failed cmake-hythloth-linux-debug-makefiles+sphinx

failed cmake-hythloth-linux-debug-makefiles+sphinx

failed cmake-hythloth-linux-debug-makefiles+sphinx

00:44:38

failed cmake-hythloth-linux-debug-makefiles+sphinx

passed cmake-minoc-linux-release-lint-iwyu-tidy

00:09:57

passed cmake-minoc-linux-release-lint-iwyu-tidy

failed cmake-moonshade-osx-debug-ninja

failed cmake-moonshade-osx-debug-ninja

00:15:15

failed cmake-moonshade-osx-debug-ninja

failed cmake-moonshade-osx-release-makefiles

failed cmake-moonshade-osx-release-makefiles

00:09:48

failed cmake-moonshade-osx-release-makefiles

failed cmake-terfin-windows-release-vs2019

failed cmake-terfin-windows-release-vs2019

failed cmake-terfin-windows-release-vs2019

00:06:38