Eventually the Esc key will close any open windows on the screen before going to the main menu (hopefully there will be a 'take all, and close' key, as well). Containers will also automatically close if you walk away from them.