Changes ninja generator to only output empty names if not already output

This builds on https://codereview.chromium.org/543743003/ .

BUG=410410
TEST=covered by test now
R=thakis@chromium.org

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

git-svn-id: http://gyp.googlecode.com/svn/trunk@1974 78cadc50-ecff-11dd-a971-7dbc132099af