Use utf-8 variant of strftime to format log file paths.

strftime assumes the format string is in locale encoding, which mangles log file paths that are in utf-8.

Fixes #767
Fixes #945