[SPARK-1901] worker should make sure executor has exited before updating executor's info

https://issues.apache.org/jira/browse/SPARK-1901

Author: Zhen Peng <zhenpeng01@baidu.com>

Closes #854 from zhpengg/bugfix-worker-kills-executor and squashes the following commits:

21d380b [Zhen Peng] add some error messages
506cea6 [Zhen Peng] add some docs for killProcess()
a0b9860 [Zhen Peng] [SPARK-1901] worker should make sure executor has exited before updating executor's info
SPARK-1972: Added support for tracking custom task-related metrics

Any piece of Spark machinery that cares to track custom task-related metrics can now use the setCustomMetric(name,value) method on TaskMetrics to do that.
The StagePage in UI now shows Custom Metrics for every task.