Decode terminal names before accessing them

Unmasks a bug (ipython/ipython#6821) that was previously hidden on
Python 3.
Set terminal name when creating new named terminal

Fixes ipython/ipython#6821