Encrypt the password before storing it to preferences. Fixes #671 /cc @maxme