Fix crash bug when close window with Ctrl-W and split screens