memtable-sstable: Convert table::try_flush_memtable_to_sstable to coroutines.
memtable-sstable: Convert table::try_flush_memtable_to_sstable to coroutines.

I intentionally store lambdas in variables and pass them to
with_scheduling_group using std::ref. Coroutines don't put variables
captured by lambdas on stack frame. If the lambda containing them is not
stored, the captured variables will be lost, resulting in stack/heap use
after free errors. An alternative is to capture variables, then create
local variables inside lambda bodies that contain a copy/moved version
of the captured ones. For example, if the post_flush lambda wasn't
stored in a dedicated variable, then it wouldn't be put on the coroutine
frame. At the first co_await inside of it, the lambda object along with
variables captured by it (old and &newtabs created inside square
brackets) would go away. The underlying objects (e.g. newtabs created in
the outer scope) would still be valid, but the reference to it would be
gone, causing most of the tests to fail.

Message-Id: <ccc27fa97d053ff4cb261f3831d09e38fb3fccf9@scylladb.com>

scylladb/scylla,scylladb/scylla,scylladb/scylla,scylladb/scylla