Bug 1092868 - Fix intermittent failing test, add a waitFor when counting app windows

https://bugzilla.mozilla.org/show_bug.cgi?id=1092868