Would it make more sense to just store the SparkContext passed to the constructor of `ContextCleaner`? You could just add a val:

    private[spark] class ContextCleaner(val sc: SparkContext) extends Logging {

Otherwise it seems a little odd here to pass a SparkContext again.