Fixed InvalidKeyError in course handler in studio.

LMS-11141

Implemented try except on ```CourseKey.from_string()``` in course handler to fix ```InvalidKeyError```.

Added test for invalid ```course_key_string```.