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: Id7f4c3f701275229714f45296eac9f7f34ff6ece
Partial-Bug: #1280100
Merge "Use six.StringIO/BytesIO instead of StringIO.StringIO"