threadsh1: Avoid heap-use-after-free.
threadsh1: Avoid heap-use-after-free.

Previously, the Canvas `Close` signal which triggers a call to the local function `close` which
was unconditionally call `Kill` on its associated thread would call it on an already deleted
object if the `TThread` was deleted before the `TCanvas`.

This fix #10015 (detected by using ASAN).

olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root