use sqlite text_factory option if set

hi,

make it possible to set the text_factory option upon initialization, not sure about the unicode=str hack for python3 ..