[bugfix] close socket when sp_add() failed in sp_listen() or sp_connect()