Main window: Fix PDF import: page rendering must be done in a separate thread

Signed-off-by: Jerome Flesch <jflesch@gmail.com>
DocSearch: Let Python-whoosh decide when optimisation of the index are required

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