ENH: use ipython StoreMagic to persist a _scan_id value.


Relies on setting 'c.StoreMagic.autorestore = True' in profile config.