Also fix type setup in prepare protocols for newer pythons.
Code copied from pysqlite3@7166533537d111f8d53f8326bd92622659531cf4