Bindings: Factor out common postMessage method logic

There's a lot of copy/pasta going on for postMessage, which needs
to do special handling for transferables (ports, array buffers, etc).
Factor out the common logic into a bindings helper function.

BUG=334408

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

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