Correctly handle unicode in MonitorMixinBase

Fixes https://github.com/numenta/nupic/issues/1397.