Have you tried implementing something along the lines suggested in man -S 2 setsid - where it says the parent should call _exit() in order for a completely successful call to setsid() ... unless it's being run in a thread. Have a look at POSIX + the appropriate man(1) pages for further details
A user level that continues to overstate my experience :-))