[SPARK-3458] enable python "with" statements for SparkContext

allow for best practice code,

```
try:
  sc = SparkContext()
  app(sc)
finally:
  sc.stop()
```

to be written using a "with" statement,

```
with SparkContext() as sc:
  app(sc)
```
self.assertIsNone(xxx) is better than self.assertEqual(xxx, None)