Fix issue where QSettings returns QPyNullVariants in some versions of PyQt