main.cc: catch all exceptions in main() and do a more graceful exit.