Partial fix for cznic/kv Close race. See camlistore.org/issue/332

And https://github.com/cznic/kv/issues/17

Change-Id: I1c3170f8a81f687715ccc1f172e41767c4c81893
Fix data race in reindexing.

See https://camlistore.org/issue/331

Change-Id: I210ae4e1779b7fe248196152a6acbc5728051249