core: a document can be closed ; db_text: improve create method ; ui_qt: improve document closing