[corlib] Clean up thread execution context