Improve handling of failed SparkContext creation attempts.