Fix bug in typechecking of scan2.
Fix bug in typechecking of scan2.

CulpaBS/wbBach,diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,mrakgr/futhark,ihc/futhark,HIPERFIT/futhark,diku-dk/futhark,mrakgr/futhark,diku-dk/futhark,ihc/futhark,ihc/futhark,HIPERFIT/futhark,mrakgr/futhark