commitlog: Take segment_manager locks first in write/flush
commitlog: Take segment_manager locks first in write/flush

While is is formally better to take a local lock first and
then first contend for a global, in this case it is arguably
better to ensure we get a gate exception synchronously (early)
instead of potentially in a continuation. Old version might
cause us to do a gate::leave even while never entered.

And since we should really only have one active (contending)
segment per shard anyway, it should not matter.

Message-Id: <a128082f9721de3e53f87561ad5a93de06e348b2@scylladb.com>

kjniemi/scylla,scylladb/scylla,raphaelsc/scylla,raphaelsc/scylla,kjniemi/scylla,scylladb/scylla,scylladb/scylla,avikivity/scylla,duarten/scylla,scylladb/scylla,raphaelsc/scylla,kjniemi/scylla,duarten/scylla,avikivity/scylla,avikivity/scylla,duarten/scylla