Fix a bug in links on forum user profile pages

Previously, if a course id contained a '-' character, links from that
page to threads would lead to 404s.

@jimabramson @kevinchugh