cleanup part 1

daemon:
  - tx socket locking
  - proper msgserver stop

interface:
  - disconnect handling started
cleanup part 2

daemon:
 - move logging to syslog
 - add the possibility to still have logs in the console by using define
 - fix msgserver bug: crash when client closes the connection

interface:
 - fix the crash during connection close