Fix yet another bytearray gotcha

If buf=bytearray(), then buf[x] is an int. IOW, buf[1]=b'\n'
is legal and works as expected, however buf[1]==10. Comparison
buf[1]==b'\n' then fails.

Fortunately, our fix appears to work in both py27 and py3.