Prevent timing attacks when verifying passwords (see #7115, #5853)