President was angered by questions over why he was seen thanking Supreme Court chief justice