SPARK-3874, Provide stable TaskContext API

//cc @rxin - should this be "isComplete" rather than "isCompleted"?