Move some common functions to common/ctdb_ltdb.c