BUG: Disable Apply button when CLI has a Completing status

If the user clicks frenetically on the Apply button, it was eventually
generating an assert in vtkSlicerCLIModuleLogic::ProcessMRMLLogicsEvents
because the button was clicked when the CLI was still "Completing".
Issue #2915

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22194 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Make vtkMRMLApplicationLogic::InvokeEventWithDelay thread-safe

If InvokeEventWithDelay was called from a different thread,
the AutoConnection in qSlicerCoreApplication was queuing the signal
therefore the InvokeRequest was deleted before the requestInvokeEvent()
slot was called.
Issue #2915

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22195 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix random crash in CLI when writing in output volume node

itkMRMLIDImageIO::Write was triggering node events (such as
vtkMRMLVolumeNode::ImageDataModifiedEvent) in a thread other than
the main thread.
The solution is to catch those events before any observer is notified,
and reschedule those events in the main thread.

Closes #2915

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22196 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Improve robustness of vtkMRMLScalarVolumeDisplayNode

Setting back the DisableModifiedEvent to 0 could be dangerous if the
node ModifiedEvent was already disabled before ProcessMRMLEvents is called.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22197 3bd1e089-480b-0410-8dfb-8563597acbee