lib: added handlink of fd close in child processes
link: moved link handling logic to new link module

this allows for add/remove of links on the fly