fix issue where color formatting text is leaking

See https://github.com/angular/protractor/issues/1131
another note, technically `data.substring(i, i+4) === '\x1B[0m'` is all that's needed to do the job, but I did `data[i] === '\x1B' && data.substring(i, i+4) === '\x1B[0m'` as a slight optimization to avoid running a substring on every character.