Close sockets after use