Dialog: Track the instance as soon as the dialog is opened

Fixes #10152
Datepicker: Abstract mouseover logic to avoid explicit event trigger

The reliance on `.mouseover()` caused an issue in some circumstances
(see #5816). The removal of `.mouseover()` broke keyboard navigation
(see #10319).

Fixes #10319
Closes gh-1290
Merge branch 'master' of git://github.com/jquery/jquery-ui into 9264-accordion-heightStyle-auto-has-problems