IDL build: factor out global objects action into a GYP template

First (simple) step in factoring out redundant GYP actions into templates.
Also moves the 'write_file_only_if_changed' flag to scripts, as that's where
it's used, which allows more simplification.

R=haraken

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

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