Fix #314 Deadlock due to locking in sqlite3_prepare_v2

* Locking database as a whole operation instead of locking per command execution.

* Add sleep workaround at the end of ReplicationTest.TestPushManyNewDocuments to ensure that all pending replication tasks are all drained.
Fixed change tracker to not throw exception when syncing with with CouchDB.

CouchDB returns "{\"results\":[\n" instead of "{\"results\":[\r\n" which was being looked for.  Updated if statement to compare against the trimmed value to remove linefeeds from the comparison.  Additionally, since CouchDB only had "\n" instead of "\r\n" the JSON exception would be about line 2, not line 3.  I removed the second part of this check since (in my opinion) testing against the exception message is a bit brittle and doesn't work with CouchDB as-is.
Port unit tests

* Port unit tests from CBL Android as of v1.0.0.
Fix PerformanceTest InvalidCastException in Android
Merge pull request #324 from couchbase/port-unit-tests

Port unit tests
Fixes #325.

BulkDownloader uses a new Uri extention method to
properly concatenate paths. Unfortunately, it failed
to properly address the case where the base uri
ended in a forward slash and the new path part started
with a forward slash.

Includes a test for all four variants.
Merge pull request #326 from couchbase/issue-325

Fixes #325.
Merge pull request #316 from couchbase/issue-314

Fix #314 Deadlock due to locking in sqlite3_prepare_v2
Converted tabs to spaces.
Bumps nuspec to 0.9.7.1. Adds TabsToSpaces setting to sln.
Merge branch 'master' of https://github.com/couchbaselabs/couchbase-lite-net
Merge pull request #321 from jonlipsky/couchdb_change_tracker

Fixed change tracker to not throw exception when syncing with with CouchDB
Added SG config for CB Server. Normalized bucket names.
When the file is uploaded as a multipart revision, the completed change count was not being incremented.
Merge pull request #327 from jonlipsky/change_count_issue

When the file is uploaded as a multipart revision, the completed change count was not being incremented.
Fix PerformanceTest.Test06PullReplication issue

* Fix PerformanceTest.Test06PullReplication issue when putting an existing doc to the sync gateway.

* Ignore the Conflict error
Check for OperationCanceledException instead of TaskCanceledException.
Merge pull request #328 from jonlipsky/task_cancellation

Check for OperationCanceledException instead of TaskCanceledException.
Transient retry handler. Unit test WIP.
Added retry handler to http client factory.