Do not allow unicode-related exceptions inside logger

Fixes #421