Python 3 fixes for urwid. Closes #243.