registry: Properly check return values from ldb_*() functions.