picload.cpp: Fix race in thread code

run() returns after hasStarted was called. Move the threadrunning set
to before that call, also to place a memory barrier behind it. This makes it
so that threadrunning is true after run(). Otherwise, there's a tiny chance
that the thread is running but threadrunning is still false.

It would be simpler to just keep that boolean in the main thread.