Ensure that we are at safepoint before trying to acquire thread attachment mutex for detachment.

Export structural safepointing API through WebHeap instead of unstructural. This is needed for the fix on the Chromium side.

BUG=339539

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

git-svn-id: svn://svn.chromium.org/blink/trunk@166232 bbb929c8-8fbe-4397-9dbb-9b2b20218538