Count pending tasks as staging in the slave.

Review: https://reviews.apache.org/r/25302
Fixed a bug in the staging tasks metric.

Review: https://reviews.apache.org/r/25303
Removed an unnecessarily introduced Option.

Review: https://reviews.apache.org/r/25304
Flattened the executor resoures when launching executors.

Review: https://reviews.apache.org/r/25306
Fixed the memory limitation construction.