Fix tornado 3.3 bug with ipython notebook