avoid crashes on cb_endprogram with plugin subwindows still opened