Close documents if open is canceled.

Implements the TODO when opening a document is canceled (e.g. at "What is the file type?")