main: add additional error checking on init
main: add additional error checking on init

More error paths so we catch things early before they unwind
into bigger errors.

Signed-off-by: Matt Porter <c1d287ff3802a4aab0e3770389ea24a33314618b@linaro.org>

bcousson/gbsim,projectara/gbsim,projectara/gbsim,gregkh/gbsim,gregkh/gbsim,bcousson/gbsim,ohporter/gbsim,bcousson/gbsim