AVRO-864. Java: Fix reflect to be able to write unions containing generic and/or specific records. Contributed by Isabel Drost.