miaspatch: Encode log file in utf-8

Otherwise we crash with an 'ascii codec can't encode...' exception.

This is one case where Python 3 would be nicer since it allows text
files to be opened with a given encoding rather than having to specify
the encode everywhere we write to it - simplifying things should we
change encodings in the future, or heaven forbid if we output to a
terminal that isn't utf-8 encoded! (Python 2 does have the concept of
auto-encoding files since it is used for tty output, but it can't be
specified for arbitrary text files... without subclassing the file class).