[Fix bug 1038055] Fix authentication login_failure() definition.

* Implement error handling.
* Fix login_failure() TypeError triggered by BrowserIDException on BrowserID post().