Close documents if open is canceled.

Implements a TODO. A close-tab is now sent to clean up documents
that failed to open properly, and a close-window is further set if
appropriate.