Fix comparison of password types.

session.flush() on models with password type with the coercion
listener active raised a TypeError before.