Streamline script streaming: better threading model.

Add a proper producer (main thread) - consumer (streamer thread) model. This
greatly simplifies the threading dance and makes it possible to add features
such as making the main thread wait until the streaming thread has finished (as
a follow-up).

Also, reduce task posting between threads, replace with proper locking.

BUG=

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

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