BatchEncoding.to with device with tests
Closes https://github.com/huggingface/transformers/issues/9580

The `torch` module isn't imported directly in the `tokenization_utils.py` file. In a similar fashion to the tensor checks, this PR adds a device check to identify if a variable is a torch device.

Adds a test that fails previous to this PR.