Fix incorrect OS detection macro use
Use QDataStream instead of QJsonDocument for unit tests

Unfortunately, QJsonDocument is inconsistent across platforms (depends
on underlying char encoding libs) and Qt version (eg QTBUG-28467 and
QTBUG-31926), so not reliable for unit testing.

Of course, QDataStream is the right approach, being binary and all,
however, I've maintained JSON outputs for better diagnoses (because
Qt's comparison of QVariants doesn't show much on failures).