Bug 772823 - Focus the main test window before closing the newly opened window in order to work around an unknown focus manager bug. r=gavin, a=test-only