astroid: fix double free of main window