login: handle 401 error

Adds template and special handling of 401 error.

As mentioned in #2316 the template was "wonky" when authorization fails. Here is a better one:

![Better](http://dl.dropbox.com/u/19162117/Selection_008.png)


1: D400 First line should end with '.', not 'n'
1: D205 Blank line missing between one-line summary and description
1: D208 Docstring is over-indented
32:1: F401 'login_required' imported but unused
32:1: F401 'UserMixin' imported but unused
170: D400 First line should end with '.', not 'd'
170: D205 Blank line missing between one-line summary and description