closes an open popup with escape key

References #951