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;