[`T5`] Fix torchquant issue
# What does this PR do?

Fixes #21839

This PR fixes a bug that was introduced with https://github.com/huggingface/transformers/pull/21281 - before this PR, the snippet below was working: 
```python
import torch
from transformers import T5ForConditionalGeneration, T5Tokenizer
model_name = "google/flan-t5-small"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
model = torch.quantization.quantize_dynamic(model, {torch.nn.Linear}, dtype=torch.qint8)
input_text = "Answer the following yes/no question by reasoning step-by-step. Can you write a whole Haiku in a single tweet?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
output = model.generate(input_ids)
```
On the `main` branch the snippet does not work anymore due to the check `self.wo.weight.dtype` since ` torch.quantization.quantize_dynamic` converts all `nn.Linear` layers to a bound function, leading to an error.
Since the users were able to run this snippet on previous versions, I think that we should support this feature.

Added also a cool test for that

cc @sgugger 

_The documentation is not available anymore as the PR was closed or merged._<|||||>Can confirm t5 & int8 slow tests are passing, merging!