Main window: Fix + cleanup refresh_docs()

Signed-off-by: Jerome Flesch <jflesch@gmail.com>
Backend/common: When instantiating a new doc, make sure it has a unique new ID

Signed-off-by: Jerome Flesch <jflesch@gmail.com>
Main window: Index update: Make sure we don't call commit() many times on the same index updater

Signed-off-by: Jerome Flesch <jflesch@gmail.com>
Doc import: Remove hack: Don't change docid after the doc has been instanciated

Signed-off-by: Jerome Flesch <jflesch@gmail.com>