Eliminate unnecessary closing of the log file.

Name returns a string that is the log file name: the channel plus the timestamp.
But on my system log.name returns the fully qualified path to the currently open file. This is because log is a file handle, so if you declare it with a path, it will be included in the name.
On systems were logging is not in the current directory, the two will never match, and the file is closed and then reopened.
Only taking the basename solves this problem.
Ensure log files are UTF-8 encoded

The default encoding is platform specific, so problems can arise if we do not
make it explicit. Especially on Windows. Freenode appears to be all UTF-8, and
irclib is giving us UTF-8 strings, so let's standardize on UTF-8.
Merge pull request #540 from esplinr/master

ChannelLogger: Improvements to file handling.