More robust exception handling in main() entry point

In some conditions we have noticed that not exiting explicitly and
allowing an Exception to bubble up causes the setuptools based command
line scripts to hang.  This commit ensures that the entry point never
allows an exception to bubble up beyond its scope.

/cc @joshmoore