Encodes password hash before passing it to bcrypt

`bcrypt.hashpw` requires that it's unicode arguments are encoded before being passed into to. While the original code encoded `password`,  the `pw_hash` wasn't. This fixes that.