Fixed linux closing of sockets