Improved 'Hashing passwords' example.

The previous example checked if an id was set in the model, and therefore may save passwords in plaintext if an id was set and a password field was submitted with form data. My change simply checks if there's a password field from the form data and hashes it.
Merge pull request #1142 from ojtibi/patch-1

Improved 'Hashing passwords' example.