Sync the database file in sqlite3_ckpt_close(), even if the checkpoint has not finished.
Add tests to check error handling in OTA.