Tooltip: Properly track hiding and closing for delegated tooltips

Fixes #10602

Could use a test.