Tweak guid handling.

I noticed our more-flexible code to handle mdashes in guids was also pulling in stuff like /robots.txt (which should just 404) and /media/foo in the dev server. So this refuses to match guids with . or / in them. I also stuck the mdash handling code into the get_canonical_guid function since it seemed to make sense there.