xmap.cc: use xfree for xmalloc'ed memory.

Conflicts:
	src/ChangeLog
fix cppcheck warning
fixed warnings from clang
fixed compile errors and a warning with clang.

Conflicts:
	src/ResMgr.h
xarray.cc: use xrealloc instead of realloc