Synthesis of N-substituted 2,4-diaminothiazoles and their salts