Remove trailing spaces from JSON dump

This commit makes JsonIRDumper remove trailing spaces and empty lines
from the output of jsoncpp writer before writing to file.

Bug: 112877706
Test: ./test.py
Change-Id: Ic3103c96ca128f40bd08bf25ae166ae04732cf11
7 files changed