Fixed segfaults of cmdline_static if loading a model file failed

Prevent passing NULL handles around by inserting REQUIRE into different location.

Fixed a SEGFAULT I observed in the static interfaces (for example cmdline_static) when trying to load a model file that does not exist.