[Bart] Cannot use Bart decoder cache with torchscript
## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
     
- `transformers` version: 3.0.2
- Platform: Linux-4.15.0-111-generic-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.5
- PyTorch version (GPU?): 1.6.0+cpu (False)
- Tensorflow version (GPU?): 2.2.0 (False)
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No

### Who can help

 Bart: @sshleifer

## Information

Model I am using (Bert, XLNet ...): Bart

The problem arises when using:
* [ ] the official example scripts: (give details below)
* [x] my own modified scripts: (give details below)

The tasks I am working on is:
* [ ] an official GLUE/SQUaD task: (give the name)
* [x] my own task or dataset: (give details below)

## To reproduce

When trying to use torchscript for Bart while passing `decoder_input_ids`:

```python
from transformers import BartModel
import torch

model = BartModel.from_pretrained("sshleifer/bart-tiny-random")
input_ids = decoder_input_ids = torch.tensor([19 * [1] + [model.config.eos_token_id]])
traced_model = torch.jit.trace(model, (input_ids, decoder_input_ids))
```

the following error occurs:
```
RuntimeError: Only tensors, lists, tuples of tensors, or dictionary of tensors can be output from traced functions
```

On the other hand if one disables the past via `model.config.use_cache = False`, then no 
error occurs. This could mean that the cache data structure should be updated to correctly work with Torchscript.

## Expected behavior

No error should occur when using Bart + Torchscript  in the way explained above.

After having fixed the bug it would be great if this line: https://github.com/huggingface/transformers/blob/ac001c48b8df1f5aadcc8cf2c71d7c1116c05250/tests/test_modeling_common.py#L252 can be removed so that a test for Bart + `past_key_value` is enabled.<|||||>thanks for writing such a good issue, I'll take a look tomorrow.<|||||>This should be looked at again after https://github.com/huggingface/transformers/pull/7474 is merged<|||||>Refactor resolves the problem -> should be fine after merge