Fix a stupid data-race. I should know better!

I had each thread in its own workgroup so the barrier() wasn't offering
any synchronisation. It just so happened to work on ARM Mali and the
NVidia GTX Titan but the data race was real on the AMD APP SDK. I now
get the right results.

I found this thanks to gvki, GPUVerify and Symbooglix:)