Prevent errors when pressing arrow keys in an empty notebook

`Notebook.get_selected_cell()` returns `null` in an empty notebook.

As a bonus, there's a CasperJS test in https://github.com/ipython/ipython/pull/3125.