Filter out unsupported types before serialization of item data.

This is rather ugly and not exactly efficient, but there is no other way
apart from trying to serialize and see if it works. QMetaType::save at
least tells us it failed, QVariant::save (which is used by operator<<) just
asserts.