Fixed unicode() input handling.

For example we can get an integer from mail segment(a number of mails in the inbox). In this case unicode() fails with TypeError.