Close popover, if requested. Fixes #835 (osx)