Unrelated to our external database lock SQLite also does internal database lock that seems to be able to croak.
If the user runs ods-ksmutil key list and at the same time the Enforcer starts working it can not succeed since key list will lock tables and Enforcer/sqlite_step() will get back SQLITE_BUSY in most cases it will exit().
Reading through the SQLite documentation it should be able to handling multiple connections (http://www.sqlite.org/faq.html#q5) SELECT'ing and INSERT'ing at the same time but it does not wait for a lock to be released by default so in some situations we will get back SQLITE_BUSY.
We should (maybe?) try and use the sqlite3_busy_timeout() function to set our own wait handler with just a sched_yield() so it will retry next context switch.