SPARK-3874, Provide stable TaskContext API

Could you add a doc here:

```
This class exists to protect the visibility of TaskContext setters.
```