Add error handling so SQLite history can recover from corrupt databases and session/line number collisions.
Add error handling so SQLite history can recover from corrupt databases and session/line number collisions.

ipython/ipython,ipython/ipython