Fixed 500 error on views with incomplete course id in url.

LMS-11217

Added try except in views to catch InvalidKeyError and raised Http404 when an incomplete course id is in url.

Added unit test.
If a view, which takes a course_id as parameter, is being called either kwargs.get("course_id") or args[0] should be defined, right?