Fix filename handling in IPython tracebacks

* Only replace filename by the value of __file__ if the latter is an
  existing text file (this fixes tracebacks for Cython files).
* When making a relative filename absolute, try to make it absolute
  w.r.t. the sys.path entries instead of the current working directory.
* Still try to display source lines for binary files, you never know
  what linecache got from that file. Skip only the reading of names,
  but display the traceback as usual.

See also downstream Sage ticket
http://trac.sagemath.org/ticket/17382
I'm not convinced that this makes sense. If we've got a relative path, that's probably because we imported something that was found locally (i.e. from the sys.path entry `''`); if `abspath()` gives the wrong answer, that's because we've changed directory since importing that. In that case, there's no particular reason to expect that the old working directory will happen to be on sys.path.

It may also find another version of the module with the same relative path from a sys.path entry, in which case you're generating a misleading traceback.