Use UTF-8 for stdout, independent of locale.

When stdout is a TTY, Python uses the terminal's locale to determine encoding. However, when stdout is a pipe or a file or some other non-TTY file handle, it uses US-ASCII by default instead. Since pyd already hard-codes UTF-8 in other places (diaryreader, diarywriter), we now force stdout to UTF-8 too.
Merge branch 'unicode-stdout'