kvstore improvements

Some tweaks to kvstore based on trying to use it in picl-tabs.

In particular, this clarifies the ability to do "set if not exists" by passing casid=null.