Fix unicode error when traceback contains any non-ascii characters

For example, `IOError` raised by OS could contain a Korean error message when it comes to Korean Windows.  `Traceback.log()` method had raised unicode error in that case, because the existing code does not reassigned the variable while `unicode.encode()` method returns a new copy rather than changes itself in place:

```python
tb.encode('utf-8', 'replace')  # existing
tb = tb.encode('utf-8', 'replace')  # fixed
```

It seems a trivial mistake, so I only changed it to reassign `tb`, and added a regression test for it.

Plus, e2a25f2308c8b399b58c8583a14be79c1f104f47 is a small fix of an already broken test on Python 2.x.