Flow system for the production of diatomic metal oxides and halides