A convenient synthesis of thiazolopyrimidines, thiazolodipyrimidines and heterocyclothiazolopyrimidines