db/commitlog: Close the segment file
db/commitlog: Close the segment file

Operations on a segment's underlying append_challenged_posix_file_impl,
such as truncate(), schedule asynchronous operations when they are
executed, which capture the file object. To synchronize with them and
prevent use-after-free, we need to call close() and only delete the
segment and file when the returned future resolves.

Signed-off-by: Duarte Nunes <a60e8b7496f7715d71354fe4c06dd24017025bf1@scylladb.com>
Message-Id: <20180216235754.24257-1-a60e8b7496f7715d71354fe4c06dd24017025bf1@scylladb.com>

avikivity/scylla,duarten/scylla,duarten/scylla,scylladb/scylla,duarten/scylla,avikivity/scylla,scylladb/scylla,avikivity/scylla,scylladb/scylla,scylladb/scylla