Add the SQLITE_DEFAULT_WORKER_THREADS compile-time option. 
Fix a NULL-pointer dereference that can occur following OOM.
Add two new static mutexes, SQLITE_MUTEX_STATIC_APP1 and _APP2, for use by
the application program.  First intended use is in test programs for the
memory allocation logic where one does not want to allocating a _FAST
or _RECURSIVE mutex since that would involve using the memory allocation
system under test.
Get SQLITE_MUTEX_STATIC_APP1 and _APP2 working for the debugMutex
implementation.
Fix a problem in the sorter causing it to return spurious SQLITE_NOMEM errors when configured to use memsys3 or memsys5.
Fix a race condition in the sorter.
Add an extra fault-injection test to sortfault.test. Remove an unreachable branch from vdbesort.c.