Fix for issue 5342.

Fix for IEDriverServer reporing "Unexpected error launching Internet
Explorer. Could not get document from window handle." after running
many WebDriver jobs.
Grab the correct Window handle, so native events still work when
in forceShellWindowsAPI mode.