cmCTestRunTest: get the default value from the environment

This only works due to some assumptions about how the `ENVIRONMENT`
property is processed. Comments have been added to notify anyone
modifying the behavior about where to look.

Fixes: #22819
3 files changed