spu: fix some threading issues