As he forged diplomatic ties with the West, Iran’s President Hassan Rouhani has been at loggerheads with the military and conservative establishment. Now, with his political survival in question, Mr. Rouhani is sounding a lot like Iran’s hard-liners.