Prevent reiterating over same stack tasks when calculating running tasks

- Clear the stack task list before each fetch and don't re-add all of them.
  There is no functional change since the tasks are added to the same set
  which will dedupe them.

Bug: 112467578
Test: atest FrameworksServicesTests:RunningTasksTest
Change-Id: I9c65771429b30d8e1d357843235b1a6deebfd402
2 files changed