Fix potential crash when removing thinker.

Removing the thinker here was causing a crash, but only when debugging.