Update keydb.c

Corrected k_read_all bug