configure_file: canonicalize input and output path in dependencies

Represent the input file path internally in canonical form.  Otherwise
multiple `configure_file` calls that share the same input file but specify
it relative to different directories (e.g. via `../`) result in multiple
copies of the dependency on the rule to re-run CMake.  This causes the
Ninja generator to emit duplicate phony build statements for these
dependencies, which generates an error with `-w dupbuild=err`, which
will be default in Ninja 1.9.

Also canonicalize the output path for consistency.

Add a test case.

Fixes: #18584
35 jobs for duplicate-configure_file-ninja-error
Status Job ID Name Coverage
  External
passed cdash

passed cmake-dash3win7-windows-release-ninja

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

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

passed cmake-moonshade-osx-debug-ninja

passed cmake-moonshade-osx-release-makefiles

passed cmake-terfin-windows-release-vs2017

passed ghostflow-check-master

passed ghostflow-stager

passed cmake-dash3win7-windows-release-ninja

00:28:42

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

00:52:30

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

00:02:46

passed cmake-moonshade-osx-debug-ninja

00:10:36

passed cmake-moonshade-osx-release-makefiles

00:20:30

passed cmake-terfin-windows-release-vs2017

00:44:45

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager