Fix platform check

Include <QtGlobal> which defines Q_OS_* before the check, otherwise it may (and does on FreeBSD) work incorrectly