[SPARK-4109][CORE] Correctly deserialize Task.stageId

The two subclasses of Task, ShuffleMapTask and ResultTask, do not correctly deserialize stageId. Therefore, the accessing of TaskContext.stageId always returns zero value to the user.

Author: luluorta <luluorta@gmail.com>

Closes #2971 from luluorta/fix-task-ser and squashes the following commits:

ff35ee6 [luluorta] correctly deserialize Task.stageId