Much of what the U.S. president has done to curb independent media echoes the Hungarian autocrat Viktor Orbán’s playbook.