Send pending tasks during re-registration.

Review: https://reviews.apache.org/r/25371
Made the GarbageCollector injectable into the Slave.

Review: https://reviews.apache.org/r/25372
Added a test for sending pending tasks during re-registration.

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