Fix logic bug introduced by 052a3de.
Add code accidentally removed in conflict resolution by 7aa72f2.
Give more helpful error messages.
Fix problem where transaction was left open.
Add vim settings.
Enable usleep in sqlite for cheaper timeouts.

Early on, chirp_job relied on sqlite3_busy_timeout to reduce EAGAIN errors to
the client. Unfortunately, it didn't behave as expected and would take
mysteriously long amounts of time to acquire locks. So, I changed the code to
usleep(2000) and then manually restart chirp_job RPCs when the database was
locked.

However, I recently noticed we simply need to set HAVE_USLEEP when compiling
sqlite3.c. This allows us to use sqlite3_busy_timeout again which
reduces/eliminates the "database is locked" messages we see.

This commit also disables pthread_mutex_* protections in sqlite3 which are
unnecessary for Chirp (as it is single-threaded).
Fix various bugs in Chirp job.

* chirp-job-bugfix:
  Enable usleep in sqlite for cheaper timeouts.
  Add vim settings.
  Fix problem where transaction was left open.
  Give more helpful error messages.
  Add code accidentally removed in conflict resolution by 7aa72f2.
  Fix logic bug introduced by 052a3de.