Tooltip: Properly track hiding and closing for delegated tooltips

Fixes #10602