Bug 1015617: close the panel directly, instead of relying on keyboard events and window focus. r=Gijs