Fix deadlock reported in RT#122709.

The need for a thread to handle incoming I/O-related callbacks did not
get accounted for properly, meaning that we didn't have enough threads
started and so deadlocked.
Fix issues with reporting warnings on threads.