Fix possible race condition in the restoreIndexWithMissingShards test

Due to a race condition the index creation operation might still try to create an index on the closing node.