Fix a few RunCMake cases that were running `ctest` without isolating it from external environment values that affect its behavior. Fixes: #24153