Tests: Fix Qt4And5Automoc tests to work on in-source build

Use a distinctly-named build directory for each case so that neither
one uses its own source tree as the build tree.

Fixes: #18159
15 jobs for automoc-test-in-place
Status Name Job ID Coverage
  External
passed ghostflow-check-master

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