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: Iba4087cb7a3dd6d1b24744cda0bfa5f45c94f386
Closes-Bug: #1280100