Thai king endorses new constitution