Close sockets when their initialization fail.