Bug 1081006 - Improve windows.waitForWindowState to also accept ID of the window to catch. r=aeftimie, r=amatei