[scan-build] Result of operation is garbage or undefined

Silence scan-build by using the return value of GetNodePosition()
although not initializing would never happen with SrcNode and
dstNode being valid (checked before).
The real bug was not using dstNode at all for the second query.
[scan-build] Result of operation is garbage or undefined (theoretical)

Simlify slightly overengineerd parent_handle_extents() to silence
scan-build complaining about theoretical undefined values.
Parents without handles simply must not exist, now also ensured by
a new unit-test.
Also removed the return value no caller cared for anyway.
[scan-build] Result of operation is garbage or undefined (invalid)

Silence sca-build by making some preconditions more clear with
asserts:
 - an object has always at least one handle
 - the number of conditions remains unchanged by Object::move()
[glib-deprecated] g_thread_init and g_type_init
[scan-buil] Result of operation is garbage or undefined (potentially)

Current users of draw_arc_with_arrows() seem to behave, but if
future users do not throw a g_warning() and try to draw the
degenerated arc at least with intialized values.
[warningectomy] No more warnings from diarenderer.c for now

diarenderer.c: In function 'draw_rounded_rect':
diarenderer.c:860:10: warning: unused variable 'color' [-Wunused-variable]
   Color *color = fill ? fill : stroke;
          ^
diarenderer.c:859:21: warning: unused variable 'center' [-Wunused-variable]
   Point start, end, center;
                     ^
diarenderer.c:859:16: warning: unused variable 'end' [-Wunused-variable]
   Point start, end, center;
                ^
diarenderer.c:859:9: warning: unused variable 'start' [-Wunused-variable]
   Point start, end, center;
         ^
diarenderer.c: In function 'bezier_render_fill':
diarenderer.c:1525:10: warning: unused variable 'n' [-Wunused-variable]
   int i, n = 0;
          ^
diarenderer.c: At top level:
diarenderer.c:1589:1: warning: no previous prototype for 'bezier_render_fill_old' [-Wmissing-prototypes]
 bezier_render_fill_old (DiaRenderer *renderer, BezPoint *pts, int total, Color *color)
 ^
diarenderer.c:1505:1: warning: '_find_close_point' defined but not used [-Wunused-function]
 _find_close_point (const BezPoint *pts, int n, const Point *p1)
 ^
3 warnings generated.
[scan-build] Result of operation is garbage or undefined (not really)

Remove one of two wrong scan-build complaints, may be used uninitialized,
but nothing is changing len since init.
[scan-build] Result of operation is garbage or undefined (not really)

Give scan-build a clue about unchanged num_handles to avoid
complaints about potentially uninitialized data.
Also comment about the copy of the code between bus and tree.
[scan-build] Result of operation is garbage or undefined (not!)

The addition od DIA_IS_DIAGRAM made scan-build belief that self->data
could be NULL and thus every later, unchecked access was marked being
suspiciuous. Avoid that by rearranging the code with diagram handling
to it's own block.
[scan-build] Dereference of null pointer (maybe)

The error handling for image conversion to string was a bit
suspiciuous. Not sure if encoding could ever fail, but now
we don't try to access a null error than.
[scan-build] Dereference of null pointer (maybe)

The current code would always have a valid renderer->dia I think.
But scan-build was right in complaining about incosnstent checking
of that. Now every access to renderer->dia is protected with a
corresponding check.
[scan-build] Dereference of null pointer (maybe)

Remove two of three 'logic error' reported by scan-build by
g_return_if_fail(). Most of the ddisp taking functions are
expecting a valid ddisp, not NULL.
The remaining issue should not hapen in real world scenario
and is caused by one of the functions where ddisp=NULL is
allowed. With display_set_active(NULL) the function in
question would crash before the reported case, though.
[scan-build] Dereference of null pointer (maybe)

Protect potential null pointer access with g_return_if_fail().
Remaining warnings show the unfinished state of focus handling:

textedit.c: In function ‘textedit_end_edit’:
textedit.c:148:19: warning: unused variable ‘change’ [-Wunused-variable]
   TextEditChange *change;
                   ^
textedit.c: In function ‘textedit_remove_focus’:
textedit.c:303:10: warning: unused variable ‘old_focus’ [-Wunused-variable]
   Focus *old_focus = get_active_focus((DiagramData *) diagram);
          ^
textedit.c: At top level:
textedit.c:370:1: warning: ‘text_edit_create_change’ defined but not used [-Wunused-function]
 text_edit_create_change(Text *text)
 ^
textedit.c:394:1: warning: ‘text_edit_update’ defined but not used [-Wunused-function]
 text_edit_update(TextEditChange *change)
 ^
textedit.c:303:10: warning: Value stored to 'old_focus' during its initialization is never read
  Focus *old_focus = get_active_focus((DiagramData *) diagram);
         ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.