Handle exceptions locally in mdb_shell

Fixes #19