Fix locals collisions with shell variables
Fix locals collisions with shell variables

Fixes issues with namespace collisions, e.g. :
```python
cfg = 'trap'
%config IPCompleter.use_jedi = False
```
Causes: `AttributeError: 'str' object has no attribute 'IPCompleter'`

fixes https://github.com/ipython/ipython/issues/11835
ipython/ipython,ipython/ipython