When indexing a view group, skip views with no map block registered yet

Fixes #438
CBL_Shared fixes

* -isDatabaseOpened: and -countForOpenedDatabase: weren't thread-safe.
* During many unit tests the FMDatabase didn't have a lock at all, so
  lock-related stuff wasn't being exercised enough.
Potentially for #500