main: catch a few unhandled errors

If any of this initialization fails, something very bad has happened, and we
should not continue as-is (this has previously manifested in strange bugs)