Prevent CTRL-D from causing NPE in shell

Update the integrated shell to deal with a null line which can be
triggered with CTRL-D.

Fixes gh-229