Fix for when the number of threads per segment exceeds group size.
Fix for when the number of threads per segment exceeds group size.

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