Write avro records to temp file