Improve statev_sql performance for sqlite.

Set magic parameters according to
http://stackoverflow.com/questions/1711631/how-do-i-improve-the-performance-of-sqlite.
statev_sql: Remove unused variables.
statev_sql: Cache and reuse context ids.