textscreen: Exit immediately when all windows close.

The main loop should exit when the last window closes, but the loop
code was waiting for one event to be received before this took
effect.

This fixes #474. Thanks to Alexandre-Xavier for the report.