Enable clean termination

Signed-off-by: Mattias Andrée <maandree@operamail.com>
Fix memory leak on termination

Signed-off-by: Mattias Andrée <maandree@operamail.com>
fix length of multicast messages

Signed-off-by: Mattias Andrée <maandree@operamail.com>
use memchr rather than strchrnul, the payload is not NUL-terminated

Signed-off-by: Mattias Andrée <maandree@operamail.com>
Fix reading of payload

Signed-off-by: Mattias Andrée <maandree@operamail.com>