Correct a bug when stopping the robot
Allows to stop a prim from within its thread.