Fix `%foo?` parsing in IPython assignment expressions (#24152)
## Summary
We now distinguish between IPython escape commands lexed after an `=`
sign from those at the start of a logical line, which allows `x = %foo?`
to be interpreted as "assign the result of running a line magic named
`foo?`", matching the IPython assignment-magic transform.
See:
https://github.com/astral-sh/ruff/issues/21705#issuecomment-4085099342.