[testing] ensure concurrent pytest workers use a unique port for torch.dist
As discussed at https://github.com/huggingface/transformers/issues/12164 currently concurrent tests may try to use the same port when running `-m torch.distributed.launch` and thus fail with `RuntimeError: Address already in use` error. This PR solves this problem by assigning a unique port to each worker when run under `pytest-xdist` with `-n 2` or higher.

It also adds 2 helper `testing_utils.py` functions:
- `pytest_xdist_worker_id`
- `get_torch_dist_unique_port`
to accomplish that.

Actually I'm not 100% sure that the original failure was caused by this problem, as it could be also caused by some run-away test that still holds the port. If this is the case I will work further on this helper function to actually test that the port it returns is free and will have to think of some extra solutions, because checking that the port is free and binding it is not atomic and there could be a race condition leading to the same problem.

But this is an important fix on its own as long as we plan to continue using pytest-xdist

Fixes: https://github.com/huggingface/transformers/issues/12164

@LysandreJik, @sgugger 