Recreate prepared statements after a exception (sqlite)