[worklets] Fixes leak document leak for AnimationWorklet.

It looks like this may have been a reference cycle between Document
and AnimationWorklet.

AnimationWorklet had a ThreadedMessagingProxyBase which held a
persistent to Document. (ThreadedMessagingProxyBase was a raw pointer).

The AnimationWorklet destructor was never being called at the right time
to destroy the ThreadedMessagingProxyBase.

Test:
./third_party/WebKit/Tools/Scripts/run-webkit-tests -t Default --additional-driver-flag=--enable-leak-detection  third_party/WebKit/LayoutTests/virtual/threaded/http/tests/worklet/animation-worklet-import.html

BUG=652535

Review-Url: https://codereview.chromium.org/2482393002
Cr-Commit-Position: refs/heads/master@{#431081}
3 files changed