Fixed #717 - testContinuousPushReplicationGoesIdleTooSoon causes native crash if unit test run from command line on OSX
Fixed #717 - testContinuousPushReplicationGoesIdleTooSoon causes native crash if unit test run from command line on OSX

- Native crash issue was addressed by couchbaselabs/couchbase-lite-java-forestdb/pull/5
- However, root cause of this issue still caused the test failure.
- Some of database access is from different threads. For example, threads run RemoteRequest. Callback codes from RemoteRequest access database.
- To make callback codes access database synchronously, add synchronized block for some database accessing codes.
- Currently I knows this two methods caused invalid database access, maybe more methods should be synchronized.

mariosotil/couchbase-lite-java-core,gotmyjobs/couchbase-lite-java-core,couchbase/couchbase-lite-java-core,mariosotil/couchbase-lite-java-core,4u7/couchbase-lite-java-core,mariosotil/couchbase-lite-java-core,Spotme/couchbase-lite-java-core