cmake: Store lowercase command names in profiling output
This ensures commands can be properly aggregated by tools processing the profiling output. I manually verified the change works on a project that uses a mix of upper and lowercase try_compile()
commands.
Fixes: #20946 (closed)
Backport: release