Fix an fd leak on the discovery socket.