fix (bug 41710)

fix
by
VG
(fixes bug 41710)

:

Ensure that background indexing processes are complete before
shutting database down.
Thanks to Natalia Shilenkova.