Fix curl slist related double append and memory leak