Unfortunately this only checks whether the stage's RDD is serializable, but won't catch problems if the function to run on it in a result stage isn't serializable. Instead of modifying this, change `submitMissingTasks`, and check that the tasks are serializable (just serialize one of them).

Also, not sure why this is being passed a `waiter`.