fixed some edge cases

detected while debugging with valgrind and the thread-sanitizer
(2 instances, 1 worker per instance, 500 clients hammering with sets/gets on the same 50 keys)