sql_db: Better exceptions.
sql_db: Better exceptions.

A closed cursor should behave the same as a closed connection, ie.
OperationalError. Also instrument a function we don't expect to be called.

xrg/openerp-server,xrg/openerp-server