Hold the main loop lock when forcing a core dump so that the singleton
data structures will be consistent.