Allow skipping NULL or invalid Variant.

Add flags in qobject2qvariant() allowing to decide if Null and Invalid
variants should be generated. This can be used to generate more compact
JSON structures.