Fixes deadlock in dialog activities and NPE in CertificateDialog in case of early Jitsi shutdown triggered by the system.