properly close popups when clicking x (closes mapbender#190)