fix deadlock in lastSQLError