Replace free() by sqlite3_free().