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

A leak of event loops may be causing test failures.
@pwendell maybe take a look at the changes here? No one in particular is responsible for this test, I think.