Refactor popup management and close callbacks

Update how popup windows are managed, so that the popup's close() function is called when it's hidden, and a new popup is created when the user asks to display it again.

This is to support properly closing child windows in the rqt_robot_monitor bag plugin.