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```.
@symbolist Yeah i think there is no need for this condition, i added this because there are some tests which were failing due to this.

Now i refactored this. does it looks good now?