Move Qt detection to configure.ac as it is different between core and plugins.
Fix a compiler warning.