[examples] [distributed] process datasets.map only on main process in 
# 🚀 Feature request

Switch examples to process `datasets.map` only once on a main process and have the other processes wait, which would make pre-processing much faster. This is based on: https://huggingface.co/docs/datasets/processing.html?highlight=map#mapping-in-a-distributed-setting

@sgugger suggested to add a new context manager `training_args.main_process_first()` to make it simple.

context: https://discuss.huggingface.co/t/slow-processing-with-map-when-using-deepspeed-or-fairscale/7229/ (albeit the title is misleading, the issue the user experienced is with any distributed framework).
