SPARK-738: Spark should detect and wrap nonserializable exceptions