Add locking when mutating RecentTasks.

Otherwise there is a really rare race condition where we try tearing
down the tasks while we're still setting them up.

Bug: 25078914
Change-Id: Icf89241f9abec3fadc8606cfb4fbc029bbe91515
1 file changed