Replace dict/BatchEncoding instance checks by Mapping
# What does this PR do?

We have several instance checks in the code base for `(dict, BatchEncoding)` (because `BatchEncoding` is a `UserDict` which is not an instance of `dict`). Those all miss the newer `BatchFeatures` (which is another `UserDict`) as was pointed out in #16983 

In Accelerate we use the more general `Mapping` from `collections.abc` for those checks (which catches any kind of `dict`), this PR suggest to do this here too.
_The documentation is not available anymore as the PR was closed or merged._