fix runtime errors in testsuite

Hi Luigi,
here are some fixes for runtime errors occuring in the testsuite when running under clang's "-fsanitize=address,undefined,integer". The changes in integralhestonvarianceoptionengine.cpp
and test-suite/markovfunctional.cpp are fixes to genuine bugs in my opinion. If one should
apply the other changes may be considered moot, but I'd say yes.
Kind regards
Peter