Test for #2727 (%run -m doesn't support relative imports)

test_run_submodule_with_relative_import fails.
Refactor part for "%run -t"
Support relative import in "%run -m"
Add a failing test for "%run -p -m ..."
Support relative import in "%run -p -m"
Add a failing test for "%run -d -m ..."
Support relative import in "%run -d -m"
Refactor part for "%run -d"
Fix ChangedPyFileTest.test_changing_py_file failure
Use list comprehension instead of filter+lambda
Add ExecutionMagics._run_with_profiler
Refactor ExecutionMagics._run_with_profiler
Rename ExecutionMagics._run_with_profiler argument
Document ExecutionMagics._run_with_profiler
Use UsageError for non-local exit + error message
Comment on "opts.merge" in _run_with_profiler
Fix %run usage line; mention -m and -e
Search for first existing directory, if cwd doesn't exist.

When starting an ipython application in a directory, that doens't exist,
search for first existing directory upwards instead of crashing.

See bug:
https://bugzilla.redhat.com/show_bug.cgi?id=593115
Report if cwd does not exist and raise exception in BaseIPythonApplication

Catch the exception in the starting scripts, report the exception
and exit gracefully. Do not directly exit in BaseIPythonApplication so
that external applications can also catch the exception instead of exiting.
Workaround so only one CTRL-C is required for a new prompt in --gui=qt

Only implemented for posix systems. On Windows SIGINT kills python,
and signal.CTRL_C_EVENT doesn't do anything.