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

A leak of event loops may be causing test failures.
@andrewor14 please take a look at the changes to this test