Fix segfault when a call with return_value_ptr ends with an exception