Use return codes from handler functions to detect socket closes and thus known when to free epoll event handler structs.  Not entirely satisfied with this as a solution.
Code tidying