[SPARK-2403] Catch all errors during serialization in DAGScheduler

https://issues.apache.org/jira/browse/SPARK-2403

Spark hangs for us whenever we forget to register a class with Kryo. This should be a simple fix for that. But let me know if you have a better suggestion.

I did not write a new test for this. It would be pretty complicated and I'm not sure it's worthwhile for such a simple change. Let me know if you disagree.
I suspect you are testing this on 2.10. Looks like a change in 2.11:

https://github.com/scala/scala/commit/64603653f82082431941cb29ad317b669822f28e#diff-ff42321ce198f97308744271b7e17c76

I think their argument applies to Spark too. Sounds like it is not safe to try and recover from StackOverflowError.

Thanks for the comments! I'll update the pull request in a moment.