I found
#define SQLITE_MISUSE 21 /* Library used incorrectly */
in the SQLite C/C++ interface documentation.
This error might occur if one or more
of the SQLite API routines is used
incorrectly. Examples of incorrect
usage include calling sqlite_exec
after the database has been closed
using sqlite_close or calling
sqlite_exec with the same database
pointer simultaneously from two
separate threads.
I'd guess that means your code is calling the interface library incorrectly around line 95716.
Later . . .
The OP confirmed that the actual problem involved two threads accessing the database at the same time, one trying to write to the db, and the other trying to close it. I'd infer from this that the offending line of code, 95716, was in the emulator. (Because the OP's code base had only 1000 lines or less.)