fix IPython.embed

without this change, IPython.embed throws the following traceback:

  File "explete.py", line 9, in dump_inputs
    IPython.embed()
  File "/home/pi/code/ipython/IPython/terminal/embed.py", line 287, in embed
    config = load_default_config()
  File "/home/pi/code/ipython/IPython/terminal/ipapp.py", line 379, in load_default_config
    for cf in Application._load_config_files("ipython_config", path=profile_dir):
  File "/home/pi/code/ipython/IPython/config/application.py", line 527, in _load_config_files
    log.debug("Loaded config file: %s", loader.full_filename)
AttributeError: 'NoneType' object has no attribute 'debug'

@Carreau was the last to poke around in this part of the code, so
pinging him, just in case
fix a NameError inside an exception
initial test for the embedding
don't raise error when config not found

load_default_config would throw exception when IPYTHONDIR was set to
some empty directory
updated test for IPython.embed()
3 at last, 3 at last, thank Guido BDFL...

we're 3 at last!
cleaner string/bytes solution, closes #4759

Thanks @takluyver for the suggestion. I'll eventually learn this
strings/bytes/unicode stuff properly for Python3.
cleaner use of process_handler
fix test for windows, just in case
Merge pull request #4789 from ivanov/fix-embed

fix IPython.embed