An American professor and vocal critic of Beijing’s censorship said he had lost his job at the prestigious Peking University and is leaving China.