Refactor: libs, tools: Add a cib__clean_up_connection function.
We have this same pattern all over the place, so reduce it to a single
common function. This is kept distinct from cib_delete in case you want
to keep the signoff cib_free_callbacks actions separate.