Catch InvalidLocationError

When invalid characters are given in a URL (unicode or other characters such as equals sign or literal space) we give a 500 error; we should catch the invalid location error that's thrown and generate a 404. 

See https://edx-wiki.atlassian.net/browse/LMS-28, https://edx-wiki.atlassian.net/browse/LMS-26

Review: @adampalay @JonahStanley