heap: Use standard C++ <atomic> to implement cross-thread pointers to PersistentNode.

Since this causes the type of the pointer for this case to change from
PersistentNode* to std::atomic<PersistentNode*>, this makes the strategy of
choosing whether to do atomic operations or not using an |if| statement invalid,
as that requires that the code in both branches be *valid* (even if it would get
optimized out later) -- since we don't have C++17's constexpr if.

As a result, those parts of PersistentBase which manipulate this pointer in that
way are moved into a member which encapsulates that logic -- PersistentNodePtr for
the single-thread case, and CrossThreadPersistentNodePtr for the cross-thread case.
These expose a compatible interface and prevent this compiler error.

Bug: 736037
Change-Id: I00ba2fb76e95d1c00be3931990361ffb374fc231
Reviewed-on: https://chromium-review.googlesource.com/c/1355840
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614857}
2 files changed