Send pthread_cancel to failed completion_timeout that has timed out.
Add a forcelog variant of applog which invalidates any console lock to force output.
Use the forcelog function on shutdown to cope with indeterminate console lock states due to killing of threads.