future-util: reduce continuations in when_all (variadic version)
future-util: reduce continuations in when_all (variadic version)

Currently, when_all() attaches a continuation to all non-ready
input futures and fulfils its promise when all continuations complete.

We can reduce this by waiting for just one of the futures to become
ready. If, during this time, other previously non-ready futures
have become ready, we don't need to wait for them.

This patch applies this optimization. Note the following details:
 - We wait for the last non-ready future first, so that if it happens
   to be the last future to complete, then we will only have waited for
   one future.
 - Since only one continuation is attached at any given time, we only
   allocate space for that one continuation, compared to the having
   previously allocated space for continuations for all futures.
 - If all futures are already ready, we continue not to allocate
   anything.
 - Type-erasure is employed to reduce code footprint.
 - if constexpr offsetof were available, this patch would be
   even more awesome.
Message-Id: <e9f53b46de27a20d770142248c56ef60fc572bb3@scylladb.com>

cloudius-systems/seastar,dreamsxin/seastar,scylladb/seastar,avikivity/seastar,scylladb/seastar,avikivity/seastar,dreamsxin/seastar,avikivity/seastar,syuu1228/seastar,dreamsxin/seastar,syuu1228/seastar,cloudius-systems/seastar,cloudius-systems/seastar,scylladb/seastar,syuu1228/seastar