sharded: avoid SIGSEGV on stop
sharded: avoid SIGSEGV on stop

If start() throws an exception, stop will eventually fail with SIGSEGV. In
particular, the instances that we didn't have the chance to initialize will be
zeroed, and when stop() will try to dereference it, this is where the problem
occurs.

Not calling stop is usually not an option: it might be the case that some
instances are initialized properly, and some are not. Also, if we don't even
register a stop function, we will crash with the all-too-common "_instances not
empty" assert.

The caller has absolutely no way to know what to do in this situation, and I
will argue that everything should be handled inside the primitive.

So if we fail, the best way to do is make sure the array is properly destroyed.
This will guarantee that the instances already constructed are destroyed, at
the same time that will present stop with an empty instances array - pretty
much nullifying its loop.

Signed-off-by: Glauber Costa <f8b79557d19b40666ebe336545a0b6178af65685@cloudius-systems.com>

norcimo5/seastar,cloudius-systems/seastar,leejir/seastar,avikivity/seastar,jonathanleang/seastar,joerg84/seastar,acbellini/seastar,chunshengster/seastar,norcimo5/seastar,jonathanleang/seastar,shyamalschandra/seastar,xtao/seastar,sjperkins/seastar,mixja/seastar,wildinto/seastar,shyamalschandra/seastar,printedheart/seastar,dwdm/seastar,avikivity/seastar,anzihenry/seastar,anzihenry/seastar,leejir/seastar,linearregression/seastar,tempbottle/seastar,dreamsxin/seastar,cloudius-systems/seastar,joerg84/seastar,sjperkins/seastar,anzihenry/seastar,dreamsxin/seastar,bowlofstew/seastar,acbellini/seastar,scylladb/seastar,cloudius-systems/seastar,scylladb/scylla-seastar,koolhazz/seastar,leejir/seastar,bowlofstew/seastar,stamhe/seastar,xtao/seastar,kjniemi/seastar,acbellini/seastar,kjniemi/seastar,linearregression/seastar,koolhazz/seastar,printedheart/seastar,shyamalschandra/seastar,stamhe/seastar,mixja/seastar,dwdm/seastar,stamhe/seastar,hongliangzhao/seastar,flashbuckets/seastar,tempbottle/seastar,jonathanleang/seastar,mixja/seastar,flashbuckets/seastar,hongliangzhao/seastar,scylladb/seastar,syuu1228/seastar,scylladb/seastar,hongliangzhao/seastar,joerg84/seastar,kjniemi/seastar,wildinto/seastar,koolhazz/seastar,syuu1228/seastar,dreamsxin/seastar,printedheart/seastar,tempbottle/seastar,wildinto/seastar,xtao/seastar,scylladb/scylla-seastar,chunshengster/seastar,bowlofstew/seastar,chunshengster/seastar,norcimo5/seastar,sjperkins/seastar,avikivity/seastar,scylladb/scylla-seastar,linearregression/seastar,syuu1228/seastar,dwdm/seastar,flashbuckets/seastar