Fix list dialog not closing on terminate possibly resulting in a crash