Add a best-effort locking primitive to HeapManagerInterface.

This will be used by the RTL when processing a crash.

BUG=
R=sebmarchand@chromium.org

Review URL: https://codereview.appspot.com/160940043