Fix endless loop when registering with a bad email address

The condition to keep looping is based on the errors array being not empty.  But the errors were not checked at the top of the loop, so the loop ran forever.

Fixes [Trello 188](https://trello.com/c/VEONBGhw)
Merge pull request #540 from datadryad/sanitize_register

Fix nasty bug, endless loop when registering with a bogus or empty email address