add make target: cflow

Generates two cflow diagrams for server and client side respectively.

The Makefile.am is not portable now, may be fixed later.
remove commented code
improve reusability of line-drawing algorithm

Separate Bresenham's line algorithm from engine_draw_line, putting it
into util/geometry. It now also supports looping the line like a list
with a special iterator.
use calloc to avoid valgrind warnings

Another problem is part of the cursor headers are read twice.
eliminate valgrind warnings

Fixes server crash on multi_windows.