[SPARK-4183] Close transport-related resources between SparkContexts

A leak of event loops may be causing test failures.
@tdas Please take a look at this change and StreamingContextSuite. The issue here is that we would not stop the spark context if we didn't start the SSC, even though the SparkContext has already been created.