FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.

Commit 321e348e (QtAutogen: Use Qt 4 IMPORTED targets to find
executable locations., 2014-01-24) attempted to fix this problem,
but only solved it for a particular ordering of find_package for
Qt 4 and Qt 5.

Add a test to ensure that it works with both orderings.
Merge topic 'fix-Qt-autogen' into next

1fc9ecfa FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.