Thai king warns over court ruling