[tracing] fix a data race in MemoryDumpManager

Fix a data race spotted by the TSan bot [1] and re-enable the
MemoryDumpManagerTest.RespectTaskRunnerAffinity test.
The race consisted in mistakenly looking into the
pmd_holder->num_pending_async_requests to determine whether the dump
should be finalized inline at the end of the current stack frame
or on the last thread hop.
In theory it is possible that the chain of posted threads is done
before hitting the num_pending_async_requests check.

[1] http://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20TSan%20Tests/builds/5757

BUG=499983

Review URL: https://codereview.chromium.org/1186053006

Cr-Commit-Position: refs/heads/master@{#334396}


CrOS-Libchrome-Original-Commit: 5dc4c114e510b6d6a9d0c5760a8fba17186d0966
2 files changed
tree: e43496dc905f420f75e3c8e597fb9923df34d802
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/