SPARK-3874, Provide stable TaskContext API

I'd prefer this class not have a constructor (the whole idea here is that we don't want user to instantiate it). Basically we want to move all of the logic here to `TaskContextImpl` and only define the interface here in terms of abstract methods.