Segfault when calling Pascal RuntimeError from within C code