Catch UnicodeEncodeError on set_cookie