Bugfix: anon_user_id from non-ascii course_id

Previously, anonymous_user_ids were calculated without correctly encoding
course_ids. This worked with courses that have names that only have ascii code
characters in them. However, this approach fails with course ids with non-ascii
characters.

The problem is, if we switch the method entirely from ascii to utf-8, there
will be compatibility issues with the pre-computed anon_user_ids in the
database (It is lazily instantiated and stored). This case, we would have to
write a script to switch records in the database manually.

So this commit solves this problem by first checking if the course id contains
non-ascii characters and encodes it as utf-8 only if it does. This way, we can
keep all the anon_ids that we have computed and kept in the db.

sdf