libctdb: more bool conversion, and accompany lock by ctdb_db in API