ccan/io: make union more generic.