store improvements

A few small bug fixes, changes to the concurrency model, and support for closing and reopening a store.

Concurrency: After this change:
1. Multiple writers are allowed
2. After a sync begins, no further writers are allowed
3. After a sync completes, multiple readers are allowed

This passes the threaded test, and some tests closing the store, reopening it, and reading back the data.