Stop using mutable global variables in multicore scheduler.
Stop using mutable global variables in multicore scheduler.

We still use a single thread-local variable to find the worker struct
for a thread, but that is harmless, as it does not prevent multiple
contexts from co-existing (they will have their own threads).

Closes #1157.

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