STYLE: Simplify RegisterNodes implementation in Markups and Annotation logic

This commit updates the code to use smart pointer.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23703 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Update EMSegment - Do not display warning when setting a null scene.

Before this commit, setting an null scene on the EMSegent widgets was
outputting the following:

335: Warning: In /path/to/EMSegment/vtkEMSegmentLogic.cxx, line 400
335: vtkEMSegmentLogic (0x4d35da0): InitializeEventListeners: no scene to listen to!
335:
335: Warning: In /path/to/EMSegment/vtkEMSegmentLogic.cxx, line 400
335: vtkEMSegmentLogic (0x4d264c0): InitializeEventListeners: no scene to listen to!

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23704 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix crash when setting null scene on Markups widget.

This commit re-organizes the code associate with function
"onActiveMarkupMRMLNodeChanged" to prevent a crash and avoid displaying
warnings when setting a null scene.

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