fix bug 1059971 - Don't attempt to close non-existant menu

To test, hover your mouse first over "Connect" in the main menu.  Warning shows in console.  This fixes said issue. 

https://bugzilla.mozilla.org/show_bug.cgi?id=1059971