fixes Bug 939981 - focus on the last submenu link closes the submenu

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