cmake: Teach -E command-line tools to print system error on failure

For example:

    Error copying directory from "foo" to "bar": No such file or directory.

Fixes: #18276
Status Job ID Name Coverage
  External
passed cdash

passed cmake-dash3win10-windows-release-ninja

00:20:05

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

00:36:52

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

00:01:14

passed cmake-moonshade-osx-debug-ninja

00:13:08

passed cmake-moonshade-osx-release-makefiles

00:12:01

passed cmake-terfin-windows-release-vs2019

02:08:00

passed ghostflow-check-master

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager