regdb: let regdb_fetch_keys() handle NULL and failure cases in the same way and return -1