Also check for previousKeyboardFocus and previousScrollFocus before cancelling a focus change
Merge pull request #2430 from duriej/master

Fix for Dialogs steal keyboard focus and don't give it back