refocus active cell on dialog close

if there is one

Otherwise, the cursor is lost on kernel restart, etc.
Merge pull request #3660 from minrk/focusclick

refocus active cell on dialog close

if there is one.

Otherwise the cursor is lost on kernel restart, etc. and the mouse must be used to get back to work.