Hold on to unacknowledged terminal tasks in the Master.

Review: https://reviews.apache.org/r/25567
Added tests for terminal unacknowledged tasks in the Master.

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