Correcting errors with batching code

Removing extra run from PeriodicThread that was
causing recursion exception.

Making sure the main process exits if
an uncaught exception is thrown in the threads spwaned.

Grouping together when batching events that belong to the same
schema and that have identical fields.

Tested in beta-labs.

Bug: 67450

Change-Id: I0f160ef25d05f6b218b97cb710ac3a411c0fd601