FIXED #1147 - [Scenario 4] Missing changes in Database Change Notification
FIXED #1147 - [Scenario 4] Missing changes in Database Change Notification

As @pasin analyzed, `changesToNotify`, `postingChangeNotifications`, `changeListeners`, and `databaseListeners` variables are not thread-safe. In this scenario, `changeListener` and `databaseListners` are not added/removed in concurrent env. These two variables don't directly cause the problem with under unit-test scenario. `changesToNotify` and `postingChangeNotifications` makes test fails. Especially, `changesToNotify`  variable. By this commit, make all four variables thread-safe. And make `postChangeNotifications()` method thread-safe by `postingChangeNotifications` variable and `lockPostingChangeNotifications` lock object.

I run `testDatabaseChangeNotification()` unit test with this fix many times with Genymotion emulator (faster test env) and Stock Emulator ARM API 19 (slower test env). With this fix, the test never failed again.

couchbase/couchbase-lite-java-core,4u7/couchbase-lite-java-core