Fixed a double counting bug for staging tasks.

Review: https://reviews.apache.org/r/28433
Removed the empty resource check in master.

Review: https://reviews.apache.org/r/28616