fixed crash due to wild pointers on model reload

pulses_setup_ppm corrupts data segment (all the way to nuking task_fn)
due to loop runaway and wild pointers. This is cause by model data
incorrect (see TODOs in pulses_setup_ppm) either temporary or due to
invalid data. There is a race condition between loading data and
sanitizing it that can cause the above crash. Also changed order of
initialization and intruduced g_modelInvalid (safer this way)