Use six.StringIO/BytesIO instead of StringIO.StringIO

to keep Python 3.x compatibility, use six.StringIO/BytesIO to
replace StringIO.StringIO

StringIO works for unicode
BytesIO works for bytes

Change-Id: Icffbbc8b1fcbf2003f7206530c4cd13fd376a59a
Closes-Bug: #1280100
Merge "Use six.StringIO/BytesIO instead of StringIO.StringIO"