simplify syslog related code
misc updates

Dynamically allocate memory for link_head, some renames and also some
refactors...