Merge pull request #25 from AlexandreBeaulne/develop

trapping exits for proper closing of sockets
check for eagain return value when calling gen_udp:send()