Raise a 401 reponse instead of redirecting to the login page

Also fixed bad tests that should have caught this.

Fixes saltstack/salt-api#155.
Merge pull request #13806 from whiteinge/rest_cherrypy-401-fix

Raise a 401 reponse instead of redirecting to the login page