SPARK-3179. Add task OutputMetrics.

This change is a followup from SPARK-2621 that @pwendell asked to include here.  Since there's not consensus on the best way to do this, and it's not really related to output metrics, I'm going to take this out.