refactoring & fixing Pytorch QA examples
# What does this PR do?

This PR improves/fixes Pytorch QA examples in several ways:
1. extracted duplicating post-processing functions (now shared between regular and no-trainer version)
2. added/fixed code to save statistics to some no-trainer versions (one was even buggy)
3. fixed squad v2-eval error in utils_qa.py (one was newly encountered and one that was previously reported. 
4. added forgotten model.eval() in the "no-trainer" versions. This fully fixed training of the **no-trainer** 
variant for the regular squad QA model. There might be still a small gap left for regular SQuAD (it might be just unlucky seed) and a big one for SQuAD v2. Please, see the numbers and the discussion below.

<!-- Remove if not applicable -->

Fixes #15401 (that was only partially fixed)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] **I believe examples aren't covered by the documentation** you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests? **I trained squad and squad v2 models and compared results (see the discussion below)**, but I am not sure if any new tests are needed. 


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Perhaps, this can be of most interest for  @sgugger, @patil-suraj.

## Comparing old and new performance

Some remaining issues:
1. Despite the fixes & improvements, there's still a discrepancy between no-trainer and original version for SQuAD v2 or the beam-search version. 
2. In particular, for SQuAD v2 and the beam-search variant **without trainer**, both old and new numbers look very wrong to me. 

Please note that to be able to run SQuAD v2 tests, **I had to apply utils_qa.py fixes to the old code as well**. Otherwise, it would have just failed:

The metric is F1, the exact scores have the same pattern.

|                                   | previous | fixed |
|-----------------------------------|----------|-------|
| squad v1                          |     88.4 |  88.4 |
| squad v1 (no trainer)             |     86.7 |  88.5 |
| squad v1 (beam search)            |     92.1 |  92.1 |
| squad v1 (beam search no trainer) |     90.2 |  91.0 |
| squad v2 (beam search)            |     83.2 |  83.2 |
| squad v2 (beam search no trainer) |      4.9 |  50.1 |
_The documentation is not available anymore as the PR was closed or merged._