Continued work on libclsync.

Common code was been moved from control.c to socket.c
Removed a memleak from libclsync.c
libclsync: more code moved from control.c to socket.c
Fixed compilation warning:

libclsync.c:75:30: warning: assignment from incompatible pointer type [enabled by default]
  threaddata_p->freefunct_arg =  free;
Added basic iteration features:

* Env-variable "CLSYNC_ITERATION"
* Option "--max-iterations"
Merge pull request #54 from xaionaro/max-iterations

Added basic iteration features:
Fixed a typo in comment
Continued the work on clsync-api
added pkg-config file
Fixed headers to be used by clsyncmgr
Removed dependency on printf_stderr in ABI
Fixed a typo
Fixed segfaults in EAPI
Unified output facility

Related: https://github.com/xaionaro/clsync/issues/31
Fixed errors from travis: 24044966
Print thread id in "error messages" on while debugging
Improved "-H" option
glob -> ctx
Removed commented stale code
"--threading=safe" mode added