Create KVStoreModel atomically

This is the right way to use get_or_create.  If you update the returned
instance after get_or_create, you are vulnerable to race conditions.

Fixes #162
Merge pull request #167 from codeinthehole/fix-integrity-error

Create KVStoreModel atomically to avoid integrity error.