gate: assert no outstanding requests when destroyed
gate: assert no outstanding requests when destroyed

Destroying a gate without close()ing it first
while there are outstanding requests will leave
behind stray asynchronous continuations.

Typically that might lead to use-after-free
when the resource referenced by the async requests
is destroyed.

Detect this in ~gate and assert that _count is 0.

Test: unit(dev), scylla/unit(dev)
Signed-off-by: Benny Halevy <23c997c90eb8537635e9392d48e7af1bf1b2ca22@scylladb.com>
Message-Id: <20210510125518.1976762-1-23c997c90eb8537635e9392d48e7af1bf1b2ca22@scylladb.com>

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