Close popover when the user hits escape and fix not calling callbacks on
escape press in modal dialog