thread-related bugfix (still, by the time of writing, the planner runs slower using pypy+jit+stm with threads than pypy+jit without them)