A court of appeals in Thailand has given a political activist a 50-year prison term for insulting the monarchy, marking what is believed to be a record sentence.