XWIKI-9909: Concurrent database migration cause SOLR indexer to fail in place of waiting

(Cherry-picked from commit 749f89be9a8eefdd1595d9ca879af102de78c869 on master)