Fix to allow avro specific types to be used

If a class generated from an avro scheme is found on the classpath, avro will create an object of that type (which extends SpecificRecordBase) instead of GenericData.Record, so we need to use IndexedRecord which is an ancestor of both GenericData.Record and SpecificRecordBase to avoid errors.