cib_delete() frees cib_op_callback_table. That should probably be inside cib_t rather than a global, so that a caller can have multiple connections open (for example, a live connection and a file connection).
There might be other problems as well.