fix crashed api test thread making a Jenkins build hang

#3129 

Not it should fail, and display the caught runtime error message