Fixing str/unicode for user agent

Creating an identifier uses the remote address and the user agent. The later is now return as a unicode, not as a string anymore. This fix used the unicode for remote adress/user agent, unless a string is given.