get _ipython_display_ method safely

use the same method we use for `_repr_foo_`
Merge pull request #5229 from minrk/safe-get-ipdisplay

get _ipython_display_ method safely