strip user input self-enrollment code

fixes CNVS-5066

when a user comes to the /registration page, they may have a
self-enrollment code (aka "Join Code" in the form) from some specific
course they're signing up for. if they enter that code with trailing (or
leading whitespace), which is particularly common when copy/pasting,
still let it work. (whitespace is never a valid part of a
self-enrollment code)

test-plan:
 - have a course with self-enrollment enabled
 - note the self-enrollment code
 - go to /register and select to register as a student
 - try to register including the course's self-enrollment code with an
   extra space character added to the end
 - registration should be successful, including creation of an
   enrollment in that course

Change-Id: I1b7c0535e437e1d5e4243d78559eaa4b6b72abdc
Reviewed-on: https://gerrit.instructure.com/39861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>