Refactor process_measures to cut down the number of savepoints, refs #98

So far we did a savepoint per batch item to get the auto-increment ids
assigned and send them to the cell/wifi_insert async tasks. This cuts down
the savepoints to one per batch (of typically 100 items). In the future this
should use some form of uuid that can be determined independently of the DB.