Expose `isLocal` in SparkContext.

Also, this adds another case which was not previously covered.