Catch zero read timeouts in Python 3

See the inline comments for an explanation of what this change does.