Reorganize the code in sqlite3ota.c in preparation for adding support for update and delete operations.
Switch back to using a single database connection in sqlite3ota.c.