WebMD and its parent company, HLTH Corp., have agreed to merge in a $1.29 billion all-stock deal, with HLTH’s Martin Wygod serving as chairman of the board at the combined company and WebMD’s Wayne Gattinella as president and CEO. An earlier merger attempt, made last year, collapsed.