Adjusted UpsertAsyncInternal to batch inserts

I encountered an issue with inserting large numbers of entities during a sync, where the generated SQL insert query exceeded sqlite's limit on bound parameters in prepared statements.

Bulk inserts are now done in batches of 200 bound parameters, e.g.
when inserting collection of records with 10 fields each, each
batch size will be 20 records.

The number 200 is arbitrary.