Close (empty) document when 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 sent
if appropriate.
Use std::string instead of document_t::mark_t

This is consistent with the marks kept by buffer_t.