Fix code generation for intra-group replicate.
Fix code generation for intra-group replicate.

diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark