text: Title: `torch.device.__enter__` does not affect `get_default_device` despite taking precedence over `set_default_device`
  Body: ### 🐛 Describe the bug
  
  Using a `torch.device` as a context manager takes precedence over `set_default_device`, but this isn't reflected by the return value of `get_default_device`.
  
  ```python
  import torch
  import torch.utils._device
  
  torch.set_default_device("cuda:1")
  
  with torch.device("cuda:0"):
      print(f"get_default_device(): {torch.get_default_device()}")
      print(f"CURRENT_DEVICE: {torch.utils._device.CURRENT_DEVICE}")
      print(f"actual current device: {torch.tensor(()).device}")
  ```
  
  ```
  get_default_device(): cuda:1
  CURRENT_DEVICE: cuda:1
  actual current device: cuda:0
  ```
  
  I feel like calling `__enter__` on the `DeviceContext` created in `torch.device`'s C++ `__enter__` implementation and `__exit__` in the C++ `__exit__` implementation might be a solution.
  
  https://github.com/pytorch/pytorch/blob/00199acdb85a4355612bff28e1018b035e0e46b9/torch/csrc/Device.cpp#L179-L197
  
  https://github.com/pytorch/pytorch/blob/00199acdb85a4355612bff28e1018b035e0e46b9/torch/utils/_device.py#L100-L104
  
  https://github.com/pytorch/pytorch/blob/00199acdb85a4355612bff28e1018b035e0e46b9/torch/__init__.py#L1134-L1147
  
  cc: @ezyang 
  
  ### Versions
  
  torch==2.6.0
  
  cc @albanD