qapi: Unit tests for visitor-based serialization