reset password fix (rebased onto dev_4_4)

This is the same as gh-3048 but rebased onto dev_4_4.

----

Back-porting reset password from #2403.

**Reset Password** should be tested using the link on the login page.

WARNING: It is very important to test if it failed on resetting password for LDAP user.

output:

```
---------- MESSAGE FOLLOWS ----------
Date: Fri, 19 Sep 2014 15:04:15 +0100 (BST)
From: user@example.com
To: test@example.com
Message-ID: <1382241711.0.1411135455063.JavaMail.ola@Mac-Book-Pro.local>
Subject: OMERO - Reset password
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Peer: 127.0.0.1

Dear Test User (test) your new password is: ***
------------ END MESSAGE ------------
```
--no-rebase