[issue3992] set/get use cases for 'env' and new 'set_env' magic

proposed fix for https://github.com/ipython/ipython/issues/3992
I don't think it could be anything else, given the code above.