close sockets on exit