1) trap the case where the model does not solve for any parameter values in the MC sample;
2) fixed initialization of alpha2_stab;
(cherry picked from commit d6993cecc4d5afc90614e817156a18b2d254ffab)
Manual cherry pick from
Commit:b0ce2dacd918d83b2b8ad6f2188a14660e802976

1) better trace all cases when the model does not solve, classifying cases according to info output of dynare_resolve;
2) trap the case of memory allocation limit for too large model undergoing to reduced form mapping
Manual cherry pick from
Commit:92e4e73765fa79c5dffd193c56feec7017ff34cd

Trap the cases where the state space matrices are not stored for memory allocation issues
[to be fixed later by breaking the big matrix stored ...]
bug fix in call to priordens;
(cherry picked from commit 597d30d0bfcacecf45a267f4d3a9c0bfa3786793)