Retry registration on credentials fail

If you've been effing around with your database, and are using the
same browser, you'll leave some credentials gunk in your localStorage.

This patch retries registration after a 401 failure.