keyvalued: fix locking non-existent indexes