compaction_manager: fix shutdown sequence
compaction_manager: fix shutdown sequence

By the time we are able to acquire this semaphore, we may be stopped
already. So we need to test it before we go ahead. I can see shutdown
hangs before this patch that are fixed with it applied.

Signed-off-by: Glauber Costa <7ba9037b0dd006f9408bd45b94707becd5cd4e87@scylladb.com>
Message-Id: <e5b378893128d086d584ffbb2acd3fb687648e5c.1481655433.git.7ba9037b0dd006f9408bd45b94707becd5cd4e87@scylladb.com>

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