Changed the RunInTransaction method in the Database class so that it runs in a SingleThreadedTaskScheduler. The ForceInsert method in the Database class now uses the RunInTransaction method.
Fixes a test that was failing sometimes because some async methods would take more time to complete than expected. Probably caused by the serialised database writes. Quick fix, should be improved.
Refactored the PutRevision method in the Database class so that it runs most of the code inside a RunInTransaction call.
Refactored the UpdateAttachment method in the Database class so that it runs inside a RunInTransaction call.
Refactored the PruneRevsToMaxDepth in the Database class so that it uses the RunInTransaction method.
Refactored the UpdateIndex method in the View class so that it uses the RunInTransaction method.
Refactored the DeleteIndex method in the View class so that it uses the RunInTransaction method.
Refactored the InsertDownloads method in the Puller class so that it uses the RunInTransaction method.
Fixes scheduler error exposed in perf tests.

Addresses an InvalidOperationException thrown during TryExecuteTaskInline.

Fixes a KeyNotFoundException in next_stmt that caused Database.Close to crash.
Likely a shared mem concurrency violation in SQLitePCL.raw.