Fixed a few more encoding issues

Bytes should always be returned from the streams, so the tests
should be checking against byte strings instead of text strings.

This also fixes the `sha_iter` as it relied on the Python 2
`iterkeys` which has been renamed to `keys` in Python 3.