Catch exceptions in `processInput` gracefully.
Fixes #1996
The exceptions bubbled up to `main` then got caught in those exception
handlers with `spicy-driver`, so something like `spicy-driver -Z` would
not emit profiling information if there was a parse error. This makes
exceptions get caught sooner so that the calling code can use the same
error mechanisms as already exist in order to gracefully exit.