sqlite3: make it possible to set text_factory upon initialization, including tests