IDL compiler: sync Python to r164106

Python side to:
Structured cloning: improve DataCloneError reporting.
https://codereview.chromium.org/114363002/

Main content is added a 'has_exception_state' template parameter,
which lets us regularize exception throwing logic
(and consistently use the |throw_type_error| macro).

The |indent| filters are because we might generate 2 lines when throwing
an exception.

BUG=239771
BUG=327994
R=haraken
NOTRY=true

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

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