channel: check for closed state in waitwindow loops