Free thread data before exiting (Bug 30269)