Serialize the final task closure as well as ShuffleDependency in taskBinary.