Small fixes to e-mail features.

I did the debugging on the staging server, and found a few things that I didn't
do right on the first try. The code as it is now has been tested by hand, with
the API test script:

    echo "{'email': 'lucas.maystre@epfl.ch'}" | ./api.py -d POST /resetpw
    echo "{'email': 'bengiuliano@gmail.com', 'password': 'bloblo'}" | ./api.py \
        -d POST /users
    echo "{'email': 'bengiuliano@gmail.com'}" | ./api.py -d POST /resetpw
    ./api.py -m bengiuliano@gmail.com -p bloblo GET /