Set cswindow NULL when closing, in case there is a selection