This is prone to race conditions if an error occurs when the EDT is waiting on a lock owned by the erroring thread. Fixes DMDirc/DMDirc#805