fix crash when stopping Orthanc during a DICOM connection