Fixed master to consolidate tasks upon slave re-registration. Review: https://reviews.apache.org/r/10724