Only change the course code using the course name if the code is nil or empty

Fixes CNVS-6235

Test plan:
- Create a course, giving a value to both the name and code.
- Update the name of the course.  The code should not change.
- Set the code to nil or empty.
- Upon saving, the code should be regenerated based on the course name.

Change-Id: Ib3c2f355c9f9cd512c54c111ee958569370d51c1
Reviewed-on: https://gerrit.instructure.com/43060
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>