Fix reset password code

+ fix password reset code to avoid non safe uri characters when enable
query strings is set to false.
Merge pull request #588 from sidewaysgravity/PasswordResetCode

Fix reset password code